22CASCFile::CASCFile(std::shared_ptr<CASC::Storage const> casc,
const char* filename,
bool warnNoExist ) :
28 std::unique_ptr<CASC::File> file(casc->OpenFile(filename, CASC_LOCALE_ALL_WOW,
false));
31 if (warnNoExist || GetCascError() != ERROR_FILE_NOT_FOUND)
37 init(file.get(), filename);
40CASCFile::CASCFile(std::shared_ptr<CASC::Storage const> casc,
uint32 fileDataId, std::string
const& description,
bool warnNoExist ) :
46 std::unique_ptr<CASC::File> file(casc->OpenFile(fileDataId, CASC_LOCALE_ALL_WOW,
false));
49 if (warnNoExist || GetCascError() != ERROR_FILE_NOT_FOUND)
55 init(file.get(), description.c_str());
void seekRelative(int offset)
CASCFile(const CASCFile &f)=delete
size_t read(void *dest, size_t bytes)
void init(CASC::File *file, const char *description)
bool ReadFile(void *buffer, uint32 bytes, uint32 *bytesRead)
char const * HumanReadableCASCError(uint32 error)
constexpr std::size_t size()