|
| | O2rArchive (const std::string &archivePath, std::shared_ptr< ResourceManager > resourceManager=nullptr, std::shared_ptr< Keystore > keystore=nullptr) |
| | Constructs an O2rArchive for the given ZIP file path.
|
| |
| | ~O2rArchive () |
| |
| bool | Open () |
| | Opens the ZIP file via libzip, creating the internal handle pool.
|
| |
| bool | Close () |
| | Closes all pooled handles and releases libzip resources.
|
| |
| bool | WriteFile (const std::string &filename, const std::vector< uint8_t > &data) |
| | Writes raw data to a file entry inside the ZIP 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 a ZIP file (.o2r format).
O2rArchive uses libzip to expose a Ship::Archive over a standard ZIP container. The ".o2r" format is the successor to the MPQ-based ".otr" format and requires no optional build flags to enable.
To improve concurrent read throughput a pool of zip_t* handles is maintained internally; reads acquire a handle from the pool and return it when done.