36 std::unique_ptr<CASC::File> file(mpq->OpenFile(fileName.c_str(), CASC_LOCALE_ALL_WOW, log));
40 int64 fileSize = file->GetSize();
54 printf(
"Error loading %s\n", fileName.c_str());
63 std::unique_ptr<CASC::File> file(mpq->OpenFile(fileDataId, CASC_LOCALE_ALL_WOW, log));
67 int64 fileSize = file->GetSize();
81 printf(
"Error loading %s\n", description.c_str());
111 { .
fcc_txt = {
'R',
'E',
'V',
'M' } },
112 { .fcc_txt = {
'N',
'I',
'A',
'M' } },
113 { .fcc_txt = {
'O',
'2',
'H',
'M' } },
114 { .fcc_txt = {
'K',
'N',
'C',
'M' } },
115 { .fcc_txt = {
'T',
'V',
'C',
'M' } },
116 { .fcc_txt = {
'O',
'M',
'W',
'M' } },
117 { .fcc_txt = {
'Q',
'L',
'C',
'M' } },
118 { .fcc_txt = {
'O',
'B',
'F',
'M' } },
119 { .fcc_txt = {
'D',
'H',
'P',
'M' } },
120 { .fcc_txt = {
'D',
'I',
'A',
'M' } }
126 if (f.fcc == fcc.
fcc)
144 std::ranges::reverse(header.
fcc_txt);
146 FileChunk& chunk =
chunks.emplace(std::piecewise_construct, std::forward_as_tuple(header.
fcc_txt, 4), std::forward_as_tuple(ptr, size))->second;
160 auto range =
chunks.equal_range(name);
161 if (std::distance(range.first, range.second) == 1)
162 return &range.first->second;
180 std::ranges::reverse(header.
fcc_txt);
182 FileChunk& chunk =
subchunks.emplace(std::piecewise_construct, std::forward_as_tuple(header.
fcc_txt, 4), std::forward_as_tuple(ptr, subsize))->second;
196 auto range =
subchunks.equal_range(name);
197 if (std::distance(range.first, range.second) == 1)
198 return &range.first->second;
FileChunk const * GetChunk(std::string_view name) const
bool loadFile(std::shared_ptr< CASC::Storage const > mpq, std::string const &fileName, bool log=true)
std::multimap< std::string_view, FileChunk > chunks
std::multimap< std::string_view, FileChunk > subchunks
FileChunk const * GetSubChunk(std::string_view name) const
bool IsInterestingChunk(u_map_fcc const &fcc)
u_map_fcc constexpr InterestingChunks[]
#define FILE_FORMAT_VERSION