ZFFramework
 
Loading...
Searching...
No Matches
ZFFile_file.h
Go to the documentation of this file.
1
5
6#ifndef _ZFI_ZFFile_file_h_
7#define _ZFI_ZFFile_file_h_
8
9#include "ZFFile_fwd.h"
11
12// ============================================================
18 , ZFMP_IN(const zfchar *, path)
19 )
25 , ZFMP_IN(const zfchar *, path)
26 )
27
33 , ZFMP_IN(const zfchar *, path)
34 , ZFMP_IN_OPT(zfbool, autoMakeParent, zftrue)
35 )
36
49 , ZFMP_IN(const zfchar *, srcPath)
50 , ZFMP_IN(const zfchar *, dstPath)
51 , ZFMP_IN_OPT(zfbool, isRecursive, zftrue)
52 , ZFMP_IN_OPT(zfbool, isForce, zftrue)
53 )
59 , ZFMP_IN(const zfchar *, srcPath)
60 , ZFMP_IN(const zfchar *, dstPath)
61 , ZFMP_IN_OPT(zfbool, isForce, zftrue)
62 )
70 , ZFMP_IN(const zfchar *, path)
71 , ZFMP_IN_OPT(zfbool, isRecursive, zftrue)
72 , ZFMP_IN_OPT(zfbool, isForce, zftrue)
73 )
74
100 , ZFMP_IN(const zfchar *, path)
102
109
116
122 , ZFMP_IN(const zfchar *, filePath)
124 , ZFMP_IN_OPT(zfbool, autoCreateParent, zftrue)
130 , ZFMP_IN(void *, token)
132
137 , ZFMP_IN(void *, token)
143 , ZFMP_IN(void *, token)
144 , ZFMP_IN(zfindex, byteSize)
145 , ZFMP_IN_OPT(ZFSeekPos, position, ZFSeekPosBegin)
147
176 , ZFMP_IN(void *, token)
177 , ZFMP_IN(void *, buf)
178 , ZFMP_IN(zfindex, maxByteSize)
180
203 , ZFMP_IN(void *, token)
204 , ZFMP_IN(const void *, src)
205 , ZFMP_IN_OPT(zfindex, maxByteSize, zfindexMax())
211 , ZFMP_IN(void *, token)
217 , ZFMP_IN(void *, token)
223 , ZFMP_IN(void *, token)
225
234 , ZFMP_IN(void *, token)
236
238#endif // #ifndef _ZFI_ZFFile_file_h_
239
#define ZFLIB_ZFCore
used to export symbols
Definition ZFCoreEnvDef.h:30
_ZFT_t_zfchar zfchar
char wrapper
Definition ZFCoreTypeDef_CharType.h:17
_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
zfbool ZFFileMove(const zfchar *srcPath, const zfchar *dstPath, zfbool isForce=(_ZFT_t_zftrue))
move a file or directory from srcPath to dstPath
void * ZFFileOpen(const zfchar *filePath, ZFFileOpenOptionFlags flag=(v_ZFFileOpenOption::e_Read), zfbool autoCreateParent=(_ZFT_t_zftrue))
open a file for read or write
zfbool ZFFileCopy(const zfchar *srcPath, const zfchar *dstPath, zfbool isRecursive=(_ZFT_t_zftrue), zfbool isForce=(_ZFT_t_zftrue))
copy a file or directory from srcPath to dstPath
zfbool ZFFileClose(void *token)
close and save the file if need, return false if save failed
zfbool ZFPathCreate(const zfchar *path, zfbool autoMakeParent=(_ZFT_t_zftrue))
make directory
void ZFFileFindClose(ZFFileFindData &fd)
zfbool ZFFileIsExist(const zfchar *path)
return true if file specified by path is exist
zfbool ZFFileFindFirst(ZFFileFindData &fd, const zfchar *path)
find file or directory, similar to FindFirstFile under Windows
zfbool ZFFileSeek(void *token, zfindex byteSize, ZFSeekPos position=(ZFSeekPosBegin))
similar to fseek, return false if seek out of range
zfbool ZFFileIsEof(void *token)
see ZFFileRead
zfindex ZFFileWrite(void *token, const void *src, zfindex maxByteSize=(((zfindex) -1)))
write file, see ZFFileRead
zfbool ZFFileIsDir(const zfchar *path)
return true if file specified by path is a directory
void ZFFileFlush(void *token)
flush the file, useful only for files opened for write
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)
zfindex ZFFileTell(void *token)
get current file's position or zfindexMax() if error
zfbool ZFFileIsError(void *token)
see ZFFileRead
zfbool ZFFileFindNext(ZFFileFindData &fd)
zfbool ZFFileRemove(const zfchar *path, zfbool isRecursive=(_ZFT_t_zftrue), zfbool isForce=(_ZFT_t_zftrue))
delete a file or directory from srcPath to dstPath
file utility
#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_DECLARE_3(ZFLIB_, ReturnType, MethodName, ZFMP_0, ZFMP_1, ZFMP_2)
see ZFMETHOD_FUNC_DECLARE_0
Definition ZFMethodFuncDeclare.h:910
#define ZFMETHOD_FUNC_DECLARE_4(ZFLIB_, ReturnType, MethodName, ZFMP_0, ZFMP_1, ZFMP_2, ZFMP_3)
see ZFMETHOD_FUNC_DECLARE_0
Definition ZFMethodFuncDeclare.h:1065
#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
data used by ZFFile when finding files
Definition ZFFile_fwd.h:53
see v_ZFFileOpenOption, ZFFileOpenOptionFlagsToString, ZFFileOpenOptionFlagsFromString
Definition ZFFile_fwd.h:44
open falgs, similar to fopen's flags, while we have binary mode only
Definition ZFFile_fwd.h:34