6#ifndef _ZFI_ZFIO_file_h_
7#define _ZFI_ZFIO_file_h_
245 virtual zfbool ioToFileName(
248 ) {
return ioToFileNameDefault(ret, pathData);}
254 ) {
return ioToChildDefault(ret, pathData, childName);}
256 virtual zfbool ioToParent(
259 ) {
return ioToParentDefault(ret, pathData);}
261 virtual zfbool ioPathCreate(
270 ) {
return ZFFileRemove(pathConvert(pathData), isRecursive, isForce);}
276 ) {
return ZFFileMove(pathConvert(pathDataFrom), pathConvert(pathDataTo), isForce);}
278 virtual zfbool ioFindFirst(
#define ZFLIB_ZFCore
used to export symbols
Definition ZFCoreEnvDef.h:30
#define zfextend
dummy macro shows class inherit from another
Definition ZFCoreTypeDef_ClassType.h:53
#define zfoverride
dummy macro shows that method override parent's method
Definition ZFCoreTypeDef_ClassType.h:58
#define ZF_IN
dummy macro that shows the param used as required input
Definition ZFCoreTypeDef_ClassType.h:180
#define ZF_IN_OPT
dummy macro that shows the param used as optional input
Definition ZFCoreTypeDef_ClassType.h:184
#define ZF_IN_OUT
dummy macro that shows the param used as required input and output
Definition ZFCoreTypeDef_ClassType.h:196
_ZFT_t_zfbool zfbool
bool type
Definition ZFCoreTypeDef_CoreType.h:103
_ZFT_t_zfindex zfindex
similar to size_t, used for index and size only
Definition ZFCoreTypeDef_CoreType.h:154
#define zftrue
bool true type
Definition ZFCoreTypeDef_CoreType.h:107
#define zfindexMax()
(zfindex)-1, indicate a max index value, see zfindex
Definition ZFCoreTypeDef_CoreType.h:159
ZFSeekPos
seek position similar to SEEK_SET of FILE operation
Definition ZFCoreTypeDef_OtherType.h:47
zft_zfstring< zfchar > zfstring
see zft_zfstring
Definition ZFCoreTypeDef_StringType.h:15
zfbool ZFFileClose(void *token)
close and save the file if need, return false if save failed
zfbool ZFFileMove(const zfstring &srcPath, const zfstring &dstPath, zfbool isForce=(_ZFT_t_zftrue))
move a file or directory from srcPath to dstPath
zfbool ZFFilePathCreate(const zfstring &path, zfbool autoCreateParent=(_ZFT_t_zftrue))
make directory
zfbool ZFFileIsDir(const zfstring &path)
return true if file specified by path is a directory
zfbool ZFFileIsExist(const zfstring &path)
return true if file specified by path is exist
zfbool ZFFileFindNext(ZFIOFindData &fd)
void ZFFileFindClose(ZFIOFindData &fd)
ZFOutput ZFOutputForFile(const zfstring &filePath)
util to create a file output callback
Definition ZFIO_file.h:51
const zfstring & ZFPathType_file()
see ZFPathInfo
zfindex ZFFileWrite(void *token, const void *src, zfindex maxByteSize=(((zfindex) -1)))
write file, see ZFFileRead
zfindex ZFFileRead(void *token, void *buf, zfindex maxByteSize)
read file
zfindex ZFFileSize(void *token)
util method to get file's total size (not left size)
zfbool ZFFileSeek(void *token, zfindex byteSize, ZFSeekPos seekPos=(ZFSeekPosBegin))
similar to fseek, return false if seek out of range
ZFInput ZFInputForFile(const zfstring &filePath)
util to create a file input callback
Definition ZFIO_file.h:33
void * ZFFileOpen(const zfstring &filePath, ZFIOOpenOptionFlags flags, zfbool autoCreateParent=(_ZFT_t_zftrue))
open a file for read or write
zfbool ZFFileRemove(const zfstring &path, zfbool isRecursive=(_ZFT_t_zftrue), zfbool isForce=(_ZFT_t_zftrue))
delete a file or directory from srcPath to dstPath
zfindex ZFFileTell(void *token)
get current file's position or zfindexMax() if error
zfbool ZFFileFindFirst(ZFIOFindData &fd, const zfstring &path)
find file or directory, similar to FindFirstFile under Windows
#define ZFIO_DECLARE(ZFLIB_, pathType)
see ZFIOImplForPathType
Definition ZFIODef_fwd.h:515
zfbool ZFInputForPathInfoT(ZFCallback &ret, const ZFPathInfo &pathInfo)
see ZFInputForPathInfo
zfbool ZFOutputForPathInfoT(ZFCallback &ret, const ZFPathInfo &pathInfo)
see ZFOutputForPathInfo
#define ZFMP_IN_OUT(ParamType, paramName)
see ZFMP_IN
Definition ZFMethod.h:117
#define ZFMP_IN_OPT(ParamType, paramName, DefaultValue)
see ZFMP_IN
Definition ZFMethod.h:108
#define ZFMP_IN(ParamType, paramName)
macro to wrap param types for ZFMETHOD_INLINE_0 series
Definition ZFMethod.h:105
#define ZFMETHOD_FUNC_DECLARE_2(ZFLIB_, ReturnType, MethodName, ZFMP_0, ZFMP_1)
see ZFMETHOD_FUNC_DECLARE_0
Definition ZFMethodFuncDeclare.h:763
#define ZFMETHOD_FUNC_INLINE_DECLARE_1(ZFLIB_, ReturnType, MethodName, ZFMP_0)
see ZFMETHOD_FUNC_DECLARE_0
Definition ZFMethodFuncDeclare.h:692
#define ZFMETHOD_FUNC_DECLARE_3(ZFLIB_, ReturnType, MethodName, ZFMP_0, ZFMP_1, ZFMP_2)
see ZFMETHOD_FUNC_DECLARE_0
Definition ZFMethodFuncDeclare.h:910
#define ZFMETHOD_FUNC_DECLARE_1(ZFLIB_, ReturnType, MethodName, ZFMP_0)
see ZFMETHOD_FUNC_DECLARE_0
Definition ZFMethodFuncDeclare.h:624
#define ZF_NAMESPACE_GLOBAL_BEGIN
begin namespace ZFFramework
Definition ZFNamespace.h:97
#define ZF_NAMESPACE_GLOBAL_END
end namespace ZFFramework
Definition ZFNamespace.h:98
#define zfclass
same as class, shows that this class is a ZFObject type
Definition ZFObjectClassTypeFwd.h:38
#define ZFOBJECT_DECLARE(ChildClass, SuperClass,...)
necessary for every class inherit from ZFObject
Definition ZFObjectDeclare.h:126
data used by ZFIO when finding files
Definition ZFIODef_fwd.h:71
see ZFIOImplForPathType
Definition ZFIODef_fwd.h:284
see v_ZFIOOpenOption, ZFIOOpenOptionFlagsToString, ZFIOOpenOptionFlagsFromString
Definition ZFIODef_fwd.h:49
general output callback
Definition ZFIOCallback_output.h:37
path related info storage for impl, actual meaning of the info depends on impl
Definition ZFPathInfo.h:34
type restrict version of zfauto
Definition zfautoFwd.h:113