| 11 | namespace Abyss::FileSystem { |
| 12 | |
| 13 | class 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 | |
| 30 | inline std::string fixPath(const std::string_view str) { |
| 31 | std::string result(str); |
nothing calls this directly
no outgoing calls
no test coverage detected