22#include <libmpq/mpq.h>
43 if(!
mpq_a || libmpq__file_number(
mpq_a,
"(listfile)", &filenum))
return;
44 libmpq__off_t size, transferred;
45 libmpq__file_size_unpacked(
mpq_a, filenum, &size);
47 char *buffer =
new char[size+1];
50 libmpq__file_read(
mpq_a, filenum, (
unsigned char*)buffer, size, &transferred);
55 token = strtok( buffer, seps );
57 while ((token !=
nullptr) && (counter < size)) {
59 token[strlen(token) - 1] = 0;
60 std::string s = token;
61 filelist.push_back(s);
62 counter += strlen(token) + 2;
63 token = strtok(
nullptr, seps);
86 size_t read(
void* dest,
size_t bytes);
92 void seek(
int offset);
110bool OpenArchives(std::string_view inputPath, std::string_view localeName);
MPQArchive(MPQArchive &&other) noexcept
MPQArchive & operator=(MPQArchive const &)=delete
MPQArchive(MPQArchive const &)=delete
MPQArchive & operator=(MPQArchive &&other) noexcept
void GetFileListTo(std::vector< std::string > &filelist)
size_t read(void *dest, size_t bytes)
void operator=(MPQFile const &)=delete
MPQFile(MPQFile const &)=delete
void seekRelative(int offset)
std::vector< MPQArchive > ArchiveSet
bool OpenArchives(std::string_view inputPath, std::string_view localeName)