![]() |
CRM64Pro GDK v0.20.0
A free cross-platform game development kit built on top of SDL 3.0
|
Archive Manager class. More...
Public Member Functions | |
| bool | info (Sint32 iMode=0) override |
| Request Archive Manager information. | |
| Sint32 | create (const string &sFile, Uint32 iNumBlocks=0) override |
| Create a new CDC file. | |
| Sint32 | close (Sint32 idCDC) override |
| Close and destroy a CDC object. | |
| Sint32 | getCount () const override |
| Get number of loaded objects. | |
| Sint32 | setName (Sint32 idCDC, const string &sName) override |
| Rename is not supported for ArchiveMgr objects. | |
| Archive * | get (Sint32 idCDC) |
| Get a pointer to the CDC using its handle. | |
| Sint32 | validate (Sint32 idCDC=0, bool bDeep=false) |
| Validate a CDC file. | |
| Sint32 | defrag (const string &sFile, Uint32 iNumBlocks=0, const Uint8 *pKey=nullptr, Uint32 iKeySize=0) |
| Defragment a CDC file. | |
| Sint32 | load (const string &sFile, const Uint8 *pKey=nullptr, Uint32 iKeySize=0) |
| Load a CDC file. | |
Archive Manager class.
|
override |
Request Archive Manager information.
Writes manager information to the default log.
| iMode | -1 to display only manager information. 0 (default) to display manager and all objects. A specific object ID displays manager information and only that object. |
|
override |
Create a new CDC file.
| sFile | string containing [directory]+filename+[extension]. The .cdc extension is added automatically if missing. Directory separators '\' and '/' are supported. |
| iNumBlocks | Maximum number of data blocks. Values below the CDCv2 default capacity use the default capacity. |
|
override |
Close and destroy a CDC object.
| idCDC | 0 to force-close all loaded CDCs, or a specific CDC id. |
|
override |
Get number of loaded objects.
|
override |
Rename is not supported for ArchiveMgr objects.
| idCDC | Unused. |
| sName | Unused. |
| Archive * CRM64Pro::ArchiveMgr::get | ( | Sint32 | idCDC | ) |
Get a pointer to the CDC using its handle.
| idCDC | CDC id. Passing 0 returns the first loaded CDC. |
| Sint32 CRM64Pro::ArchiveMgr::validate | ( | Sint32 | idCDC = 0, |
| bool | bDeep = false ) |
Validate a CDC file.
| idCDC | 0 for the first opened CDC or the CDC id. |
| bDeep | false for structural validation, true to also verify active stored payload hashes and plaintext hashes when possible. |
| Sint32 CRM64Pro::ArchiveMgr::defrag | ( | const string & | sFile, |
| Uint32 | iNumBlocks = 0, | ||
| const Uint8 * | pKey = nullptr, | ||
| Uint32 | iKeySize = 0 ) |
Defragment a CDC file.
| sFile | string containing [directory]+filename+[extension]. Directory separators '\' and '/' are supported. |
| iNumBlocks | Maximum number of data blocks. Default 0 preserves the current block limit. Non-zero values can be used to resize the maximum number of data blocks. |
| pKey | key required when defragmenting a CDC with an encrypted index. |
| iKeySize | size in bytes of pKey. Values from 1 to 32 are accepted when pKey is provided. |
| Sint32 CRM64Pro::ArchiveMgr::load | ( | const string & | sFile, |
| const Uint8 * | pKey = nullptr, | ||
| Uint32 | iKeySize = 0 ) |
Load a CDC file.
The Archive Manager shares ids based on file path as the key, so it checks if a CDC is already loaded before creating a new one. If the CDC is already loaded, the supplied key must be compatible with the open CDC. Encrypted CDC files require the same key for every shared open. Unencrypted CDC files can be shared without a key, but a different key is rejected when the already opened CDC has a key attached.
| sFile | string containing [directory]+filename+[extension]. Directory separators '\' and '/' are supported. |
| pKey | Uint8 array containing the key. Required when the CDC index is encrypted. |
| iKeySize | key size in bytes. Values from 1 to 32 are accepted when pKey is provided. |