abstract IO More...
#include "ZFIODef.h"
Go to the source code of this file.
Functions | |
const zfstring & | ZFPathType_file () |
see ZFPathInfo | |
ZFInput | ZFInputForFile (const zfstring &filePath) |
util to create a file input callback | |
ZFOutput | ZFOutputForFile (const zfstring &filePath) |
util to create a file output callback | |
zfbool | ZFFileIsExist (const zfstring &path) |
return true if file specified by path is exist | |
zfbool | ZFFileIsDir (const zfstring &path) |
return true if file specified by path is a directory | |
zfbool | ZFFilePathCreate (const zfstring &path, zfbool autoCreateParent=(_ZFT_t_zftrue)) |
make directory | |
zfbool | ZFFileRemove (const zfstring &path, zfbool isRecursive=(_ZFT_t_zftrue), zfbool isForce=(_ZFT_t_zftrue)) |
delete a file or directory from srcPath to dstPath | |
zfbool | ZFFileMove (const zfstring &srcPath, const zfstring &dstPath, zfbool isForce=(_ZFT_t_zftrue)) |
move a file or directory from srcPath to dstPath | |
zfbool | ZFFileFindFirst (ZFIOFindData &fd, const zfstring &path) |
find file or directory, similar to FindFirstFile under Windows | |
zfbool | ZFFileFindNext (ZFIOFindData &fd) |
void | ZFFileFindClose (ZFIOFindData &fd) |
void * | ZFFileOpen (const zfstring &filePath, ZFIOOpenOptionFlags flags, zfbool autoCreateParent=(_ZFT_t_zftrue)) |
open a file for read or write | |
zfbool | ZFFileClose (void *token) |
close and save the file if need, return false if save failed | |
zfindex | ZFFileRead (void *token, void *buf, zfindex maxByteSize) |
read file | |
zfindex | ZFFileWrite (void *token, const void *src, zfindex maxByteSize=(((zfindex) -1))) |
write file, see ZFFileRead | |
zfbool | ZFFileSeek (void *token, zfindex byteSize, ZFSeekPos seekPos=(ZFSeekPosBegin)) |
similar to fseek, return false if seek out of range | |
zfindex | ZFFileTell (void *token) |
get current file's position or zfindexMax() if error | |
zfindex | ZFFileSize (void *token) |
util method to get file's total size (not left size) | |
abstract IO
|
extern |
see ZFPathInfo
pathData is the file path
util to create a file input callback
param:
auto open and auto close files, may return a null callback if open file error
auto setup callback cache id with res file path
util to create a file output callback
param:
auto open and auto close files, may return a null callback if open file error
return true if file specified by path is exist
return true if file specified by path is a directory
make directory
|
extern |
delete a file or directory from srcPath to dstPath
fail if isRecursive is zffalse and dst is a dir
|
extern |
move a file or directory from srcPath to dstPath
|
extern |
find file or directory, similar to FindFirstFile under Windows
path supports path only, without wildcard support, e.g. "/path/" or "/path", "." and ".." won't be included
typical usage:
|
extern |
|
extern |
|
extern |
open a file for read or write
read file
return size read, even if error occurred, typical usage:
note that the tail '\0' won't be written to buf
|
extern |
write file, see ZFFileRead
return size written, even if error occurred, typical usage:
maxByteSize could be zfindexMax(), which means ZFFileWrite should be stopped when reached 0x00 in src, usually to output a UTF8 string
|
extern |
util method to get file's total size (not left size)
ZFFileSeek to end, ZFFileTell, then ZFFileSeek to restore, return zfindexMax() if error
note that result is not ensured if file is opened in append mode