Interface to manage DPF.
Public Member Functions | |
| int | Create (char *filename) |
| Create a new DPF v4.0. | |
| int | Open (char *filename) |
| Load a DPF v4.0. If you open a v3.0, it will update it automatically to v4.0. | |
| void | Close (int idDPF) |
| Close a DPF. | |
| int | AddData (int idDPF, DPF_BlockData *info) |
| Add a data block to the given DPF. | |
| int | AddFile (int idDPF, char *filename) |
| Add a file to a DPF. | |
| int | LoadBlock (int idDPF, char *type, char *name, DPF_BlockData *info) |
| Load the block that matches the given type and name. | |
| int | FreeBlock (DPF_BlockData *) |
| Free a loaded block. | |
| int | Delete (int idDPF, DPF_BlockData *info) |
| Delete a specific block. | |
| int | Search (int idDPF, DPF_BlockData *info) |
| Search for a specific block. | |
| int | FindFirst (int idDPF, DPF_BlockData *info) |
| Find first block on the given DPF. | |
| int | FindNext (int idDPF, DPF_BlockData *info) |
| Find next block. | |
| void | SetAccessMode (char mode) |
| Set access mode to blocks on DPF. | |
| void | SetPassword (unsigned char *key, unsigned char keylen) |
| Set the password to access to your protected DPF. | |
| char * | GetFilename (int idDPF) |
| Get the filename given a valid idDPF. | |
| void | Flush (int idDPF) |
| Flush the given idDPF. | |
| int | Compact (char *filename) |
| Compact a DPF removing all deleted blocks. It can also fix a block corruption. | |
| int | Protect (char *filename, unsigned char *key, unsigned char keylen) |
| Protect your DPF with heavy encription creating a new DPF. | |
| int | UnProtect (char *filename, unsigned char *key, unsigned char keylen) |
| Unprotect your previously protected DPF. | |
| int | GetNumBlocks (int idDPF) |
| Return total blocks number(including working and deleted ones) of given DPF. | |
| int | GetNumDelBlocks (int idDPF) |
| Return only deleted blocks number of given DPF. | |
| char | GetFragment (int idDPF) |
| Return fragmentation percent of given DPF. | |
| int | GetSize (int idDPF) |
| Return total file size. | |
| int CRM32Pro_IStuffDPF::AddData | ( | int | idDPF, | |
| DPF_BlockData * | info | |||
| ) |
Add a data block to the given DPF.
| idDPF | DPF's ID to add data | |
| info | filled data block |
0 Failed.
any other positive value, Ok and packed size of the added block
| int CRM32Pro_IStuffDPF::AddFile | ( | int | idDPF, | |
| char * | filename | |||
| ) |
Add a file to a DPF.
| idDPF | DPF's ID to add file | |
| filename | file to be added |
0 Failed.
any other positive value, Ok and packed size of the added block
| void CRM32Pro_IStuffDPF::Close | ( | int | idDPF | ) |
Close a DPF.
| idDPF | DPF's ID to close |
| int CRM32Pro_IStuffDPF::Compact | ( | char * | filename | ) |
Compact a DPF removing all deleted blocks. It can also fix a block corruption.
Note that it performs a physical delete. The given DPF must be closed before to call this method.
| filename | DPF file name to perform the compact process. |
1 Ok
| int CRM32Pro_IStuffDPF::Create | ( | char * | filename | ) |
Create a new DPF v4.0.
| filename | name and optional path of the new DPF |
any other value, the DPF's ID
| int CRM32Pro_IStuffDPF::Delete | ( | int | idDPF, | |
| DPF_BlockData * | info | |||
| ) |
Delete a specific block.
Note this is a logical delete
| idDPF | DPF's ID to delete given block | |
| info | filled data block to search and delete(only name and type are needed) |
1 Ok
| int CRM32Pro_IStuffDPF::FindFirst | ( | int | idDPF, | |
| DPF_BlockData * | info | |||
| ) |
Find first block on the given DPF.
| idDPF | DPF's ID to find first block | |
| info | filled data block(only info, not data) |
1 There was block found
2 2 Error
| int CRM32Pro_IStuffDPF::FindNext | ( | int | idDPF, | |
| DPF_BlockData * | info | |||
| ) |
Find next block.
| idDPF | DPF's ID to find next block | |
| info | filled data block(only info, not data) |
1 There was block found
2 Error
| void CRM32Pro_IStuffDPF::Flush | ( | int | idDPF | ) |
Flush the given idDPF.
IStuffDPF uses buffering algorithms to speedup all IO operations. Once you save a data block, it may not be immediately saved to disk. If you want to assure this, you have to flush the given idDPF.
| idDPF | DPF's ID to flush |
| char * CRM32Pro_IStuffDPF::GetFilename | ( | int | idDPF | ) |
Get the filename given a valid idDPF.
| idDPF | DPF's ID to get its filename |
| char CRM32Pro_IStuffDPF::GetFragment | ( | int | idDPF | ) |
Return fragmentation percent of given DPF.
| idDPF | DPF's ID to get fragment percent |
| int CRM32Pro_IStuffDPF::GetNumBlocks | ( | int | idDPF | ) |
Return total blocks number(including working and deleted ones) of given DPF.
| idDPF | DPF's ID to count blocks |
| int CRM32Pro_IStuffDPF::GetNumDelBlocks | ( | int | idDPF | ) |
Return only deleted blocks number of given DPF.
| idDPF | DPF's ID to count deleted blocks |
any other value, the number of deleted blocks
| int CRM32Pro_IStuffDPF::GetSize | ( | int | idDPF | ) |
Return total file size.
| idDPF | DPF's ID to get size |
| int CRM32Pro_IStuffDPF::LoadBlock | ( | int | idDPF, | |
| char * | type, | |||
| char * | name, | |||
| DPF_BlockData * | info | |||
| ) |
Load the block that matches the given type and name.
Note that once you have finish to work with returned data of info struct, you must free it using FreeBlock().
| idDPF | DPF's ID to load block | |
| type | block type(examples of defined:"FILE","TILE"..) | |
| name | name of block. It is case sensitive. | |
| info | when return Ok, it has the required data |
any other value, Ok and the real size(not the packed one) of loaded block
| int CRM32Pro_IStuffDPF::Open | ( | char * | filename | ) |
Load a DPF v4.0. If you open a v3.0, it will update it automatically to v4.0.
| filename | name of file |
any other value, the DPF's ID(idDPF)
| int CRM32Pro_IStuffDPF::Search | ( | int | idDPF, | |
| DPF_BlockData * | info | |||
| ) |
Search for a specific block.
| idDPF | DPF's ID to find the given block | |
| info | pointer to DPF_BlockData struct with the name and type to look for. If it is found, it returns more information and data = NULL |
1 The given block was found
2 Error
1.4.7