file utility More...
#include "ZFFile_fwd.h"
Go to the source code of this file.
Functions | |
void | ZFResExtPathAdd (const ZFPathInfo &pathInfo) |
add an additional path to search as resource files | |
void | ZFResExtPathRemove (const ZFPathInfo &pathInfo) |
see ZFResExtPathAdd | |
ZFCoreArray< ZFPathInfo > | ZFResExtPathList () |
see ZFResExtPathAdd | |
zfbool | ZFResExtPathCheck (ZFPathInfo &resExtPath, const zfchar *resPath) |
see ZFResExtPathAdd | |
zfbool | ZFResIsExist (const zfchar *resPath) |
return true if res file specified by path is exist | |
zfbool | ZFResIsDir (const zfchar *resPath) |
return true if res file specified by path is a directory | |
zfbool | ZFResCopy (const zfchar *resPath, const zfchar *dstPath, zfbool isRecursive=(_ZFT_t_zftrue), zfbool isForce=(_ZFT_t_zftrue)) |
res version of ZFFileCopy | |
zfbool | ZFResFindFirst (ZFFileFindData &fd, const zfchar *resPath) |
zfbool | ZFResFindNext (ZFFileFindData &fd) |
void | ZFResFindClose (ZFFileFindData &fd) |
void * | ZFResOpen (const zfchar *resPath) |
open a resource file for read only, see ZFFileOpen | |
zfbool | ZFResClose (void *token) |
see ZFResOpen ZFFileClose | |
zfindex | ZFResTell (void *token) |
see ZFResOpen ZFFileTell | |
zfbool | ZFResSeek (void *token, zfindex byteSize, ZFSeekPos position=(ZFSeekPosBegin)) |
see ZFResOpen ZFFileSeek | |
zfindex | ZFResRead (void *token, void *buf, zfindex maxByteSize) |
see ZFResOpen ZFFileRead | |
zfbool | ZFResIsEof (void *token) |
see ZFResOpen ZFFileIsEof | |
zfbool | ZFResIsError (void *token) |
see ZFResOpen ZFFileIsEof | |
zfindex | ZFResSize (void *token) |
see ZFResOpen, ZFFileSize | |
file utility
|
extern |
add an additional path to search as resource files
by default, resource files are placed in a fixed builtin location, you may add additional path to search as resource files
to make things clear, while accessing resource files using a res path, we would:
this method would affect all methods that process with resource files, such as ZFResCopy, ZFResOpen, ZFResRead
typically, additional resource path should be modified during startup only
|
extern |
see ZFResExtPathAdd
return the registered additional resource path if file exist, or null if not exist
if return value is not null, the final file path should be "return value + '/' + resPath"
return true if res file specified by path is exist
return true if res file specified by path is a directory
|
extern |
res version of ZFFileCopy
|
extern |
use empty string to find resource's root directory
|
extern |
|
extern |
|
extern |
open a resource file for read only, see ZFFileOpen
since the resource files may or may not be opened by normal method (i.e. ZFFileOpen), such as those in Android project which are located in apk/assets, so use ZFResOpen and ZFResFindFirst to access it for cross-platform
also, since the resource files may or may not be compressed into app, accessing them may or may not take much time
a resource file is a file in "zfres" directory of native project, such as "project_path/zfres/1.png" and "project_path/zfres/subdir/1.png", which should be "1.png" and "subdir/1.png" when ZFResOpen
file name could be the same if under different directories, and is recommended to keep all lower case for cross-platform
note that the token is defined same type as the one used by ZFFileOpen, it's your responsibility to make sure not to misuse it
ADVANCED:
resource can be "extended" by ZFResExtPathAdd, use ZFResRaw series to bypass the logic