Zip file - reader helper class. More...
#include <ZipUtils.h>
Public Member Functions | |
ZipFile (const std::string &zipFile, const std::string &filter=std::string()) | |
Constructor, open zip file and store file list. More... | |
virtual | ~ZipFile () |
bool | setFilter (const std::string &filter) |
Regenerate accessible file list based on a new filter string. More... | |
bool | fileExists (const std::string &fileName) const |
Check does a file exists or not in zip file. More... | |
unsigned char * | getFileData (const std::string &fileName, ssize_t *size) |
Get resource file data from a zip file. More... | |
Zip file - reader helper class.
It will cache the file list of a particular zip file with positions inside an archive, so it would be much faster to read some particular files or to check their existance.
ZipFile | ( | const std::string & | zipFile, |
const std::string & | filter = std::string() |
||
) |
Constructor, open zip file and store file list.
zipFile | Zip file name |
filter | The first part of file names, which should be accessible. For example, "assets/". Other files will be missed. |
|
virtual |
bool fileExists | ( | const std::string & | fileName) | const |
Check does a file exists or not in zip file.
fileName | File to be checked on existance |
unsigned char* getFileData | ( | const std::string & | fileName, |
ssize_t * | size | ||
) |
Get resource file data from a zip file.
fileName | File name | |
[out] | pSize | If the file read operation succeeds, it will be the data size, otherwise 0. |
bool setFilter | ( | const std::string & | filter) |
Regenerate accessible file list based on a new filter string.
filter | New filter string (first part of files names) |