18#define _CRT_SECURE_NO_DEPRECATE
39 std::unique_ptr<CASC::File> file(mpq->OpenFile(fileName.c_str(), CASC_LOCALE_ALL_WOW, log));
43 int64 fileSize = file->GetSize();
57 printf(
"Error loading %s\n", fileName.c_str());
66 std::unique_ptr<CASC::File> file(mpq->OpenFile(fileDataId, CASC_LOCALE_ALL_WOW, log));
70 int64 fileSize = file->GetSize();
84 printf(
"Error loading %s\n", description.c_str());
107 for (
auto& chunk :
chunks)
119 { {
'R',
'E',
'V',
'M' } },
120 { {
'N',
'I',
'A',
'M' } },
121 { {
'O',
'2',
'H',
'M' } },
122 { {
'K',
'N',
'C',
'M' } },
123 { {
'T',
'V',
'C',
'M' } },
124 { {
'O',
'M',
'W',
'M' } },
125 { {
'Q',
'L',
'C',
'M' } },
126 { {
'O',
'B',
'F',
'M' } },
127 { {
'D',
'H',
'P',
'M' } },
128 { {
'D',
'I',
'A',
'M' } }
134 if (f.fcc == fcc.
fcc)
170 auto range =
chunks.equal_range(name);
171 if (std::distance(range.first, range.second) == 1)
172 return range.first->second;
180 delete subchunk.second;
214 auto range =
subchunks.equal_range(name);
215 if (std::distance(range.first, range.second) == 1)
216 return range.first->second;
FileChunk * GetChunk(std::string const &name)
std::multimap< std::string, FileChunk * > chunks
bool loadFile(std::shared_ptr< CASC::Storage const > mpq, std::string const &fileName, bool log=true)
FileChunk(uint8 *data_, uint32 size_)
std::multimap< std::string, FileChunk * > subchunks
FileChunk * GetSubChunk(std::string const &name)
bool IsInterestingChunk(u_map_fcc const &fcc)
u_map_fcc InterestingChunks[]
#define FILE_FORMAT_VERSION
constexpr std::size_t size()