|
| | OtrArchive (const std::string &archivePath, std::shared_ptr< ResourceManager > resourceManager=nullptr, std::shared_ptr< Keystore > keystore=nullptr) |
| | Constructs an OtrArchive for the given MPQ file path.
|
| |
| | ~OtrArchive () |
| |
| bool | Open () |
| | Opens the underlying MPQ file via StormLib.
|
| |
| bool | Close () |
| | Closes the MPQ file handle and releases StormLib resources.
|
| |
| bool | WriteFile (const std::string &filename, const std::vector< uint8_t > &data) |
| | Writes raw data to a file entry inside the MPQ archive.
|
| |
| std::shared_ptr< File > | LoadFile (const std::string &filePath) |
| | Loads a file from the archive by its virtual path.
|
| |
| std::shared_ptr< File > | LoadFile (uint64_t hash) |
| | Loads a file from the archive by its 64-bit hash.
|
| |
| | Archive (const std::string &path, std::shared_ptr< ResourceManager > resourceManager=nullptr, std::shared_ptr< Keystore > keystore=nullptr) |
| | Constructs an Archive for the given filesystem path.
|
| |
| | ~Archive () |
| |
| bool | operator== (const Archive &rhs) const |
| | Two archives are equal when they refer to the same underlying path.
|
| |
| void | Load () |
| | Opens and indexes the archive, making its contents available for loading.
|
| |
| void | Unload () |
| | Closes the archive and releases all associated resources.
|
| |
| std::shared_ptr< std::unordered_map< uint64_t, std::string > > | ListFiles () |
| | Returns a map of all files indexed in this archive (hash → path).
|
| |
| std::shared_ptr< std::unordered_map< uint64_t, std::string > > | ListFiles (const std::string &filter) |
| | Returns only the files whose paths match the given filter string.
|
| |
| bool | HasFile (const std::string &filePath) |
| | Checks whether the archive contains a file at the given path.
|
| |
| bool | HasFile (uint64_t hash) |
| | Checks whether the archive contains a file with the given hash.
|
| |
| bool | HasGameVersion () |
| | Returns true if a game version value was found in the manifest.
|
| |
| uint32_t | GetGameVersion () |
| | Returns the game version encoded in the archive manifest.
|
| |
| const ArchiveManifest & | GetManifest () |
| | Returns the parsed archive manifest.
|
| |
| bool | IsSigned () |
| | Returns true if the archive carries a digital signature in its manifest.
|
| |
| bool | IsChecksumValid () |
| | Returns true if the archive's checksum field matches the computed checksum.
|
| |
| const std::string & | GetPath () |
| | Returns the filesystem path this archive was opened from.
|
| |
| bool | IsInitialized () |
| | Returns true if the archive has been successfully initialized/opened.
|
| |
Archive implementation backed by an MPQ file (Blizzard's MoPaQ format).
OtrArchive wraps StormLib to expose a Ship::Archive over an ".otr" file, which is structurally an MPQ archive. This class is only compiled when the project is built with MPQ support enabled (-DINCLUDE_MPQ_SUPPORT).
All file I/O operations are thread-safe via the StormLib handle.
- Deprecated:
- OtrArchive and the ".otr" format are deprecated in favour of the ".o2r" format backed by Ship::O2rArchive. MPQ support is disabled by default; opt in with
-DINCLUDE_MPQ_SUPPORT=ON only for projects that still need to load legacy ".otr" archives. New projects should use the ".o2r" format exclusively.