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

Class MPQStream

src/Abyss/FileSystem/MPQ.cpp:13–28  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11namespace Abyss::FileSystem {
12
13class MPQStream final : public SizeableStreambuf {
14 HANDLE _mpqFile = nullptr;
15 std::streamsize _startOfBlock = 0;
16 char _buffer[2048] = {};
17
18 public:
19 MPQStream(HANDLE mpq, const std::string &fileName);
20 ~MPQStream() override { SFileCloseFile(_mpqFile); }
21 [[nodiscard]] std::streamsize StartOfBlockForTesting() const;
22
23 protected:
24 int underflow() override;
25 pos_type seekpos(pos_type pos, std::ios_base::openmode which) override;
26 pos_type seekoff(off_type off, std::ios_base::seekdir dir, std::ios_base::openmode which) override;
27 [[nodiscard]] std::streamsize size() const override;
28};
29
30inline std::string fixPath(const std::string_view str) {
31 std::string result(str);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected