MCPcopy Create free account
hub / github.com/AbyssEngine/AbyssEngineOld / MPQ

Method MPQ

src/Abyss/FileSystem/MPQ.cpp:94–100  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

92std::streamsize MPQStream::size() const { return SFileGetFileSize(_mpqFile, nullptr); }
93
94MPQ::MPQ(const std::filesystem::path &mpqPath) : _stormMpq(nullptr) {
95 std::string path = std::filesystem::absolute(mpqPath).string();
96 Common::Log::debug("Opening MPQ {}", path);
97 if (!SFileOpenArchive(path.c_str(), 0, STREAM_PROVIDER_FLAT | BASE_PROVIDER_FILE | STREAM_FLAG_READ_ONLY, &_stormMpq)) {
98 throw std::runtime_error(absl::StrCat("Error occurred while opening MPQ ", mpqPath.string()));
99 }
100}
101
102MPQ::~MPQ() { SFileCloseArchive(_stormMpq); }
103

Callers

nothing calls this directly

Calls 1

debugFunction · 0.85

Tested by

no test coverage detected