ZFFramework
 
Loading...
Searching...
No Matches
ZFIODef_util.h
Go to the documentation of this file.
1
5
6#ifndef _ZFI_ZFIODef_util_h_
7#define _ZFI_ZFIODef_util_h_
8
9#include "ZFIODef_fwd.h"
10
12
13// ============================================================
31 , ZFMP_IN_OUT(zfstring &, ret)
32 , ZFMP_IN(const zfchar *, src)
33 , ZFMP_IN_OPT(zfindex, srcLen, zfindexMax())
34 )
37 , ZFMP_IN(const zfchar *, src)
38 , ZFMP_IN_OPT(zfindex, srcLen, zfindexMax())
39 ) {
40 zfstring ret;
41 ZFPathFormatT(ret, src, srcLen);
42 return ret;
43}
44
49 , ZFMP_IN_OUT(zfstring &, ret)
50 , ZFMP_IN(const zfchar *, src)
51 , ZFMP_IN_OPT(zfindex, srcLen, zfindexMax())
52 )
55 , ZFMP_IN(const zfchar *, src)
56 , ZFMP_IN_OPT(zfindex, srcLen, zfindexMax())
57 ) {
58 zfstring ret;
59 ZFPathFormatRelativeT(ret, src, srcLen);
60 return ret;
61}
62
69 , ZFMP_OUT(zfstring &, ret)
70 , ZFMP_IN(const zfchar *, src)
71 )
74 , ZFMP_IN(const zfchar *, src)
75 )
82 , ZFMP_OUT(zfstring &, ret)
83 , ZFMP_IN(const zfchar *, src)
84 )
87 , ZFMP_IN(const zfchar *, src)
88 )
96 , ZFMP_OUT(zfstring &, ret)
97 , ZFMP_IN(const zfchar *, src)
98 )
101 , ZFMP_IN(const zfchar *, src)
110 , ZFMP_OUT(zfstring &, ret)
111 , ZFMP_IN(const zfchar *, src)
115 , ZFMP_IN(const zfchar *, src)
124 , ZFMP_OUT(zfstring &, ret)
125 , ZFMP_IN(const zfchar *, src)
129 , ZFMP_IN(const zfchar *, src)
138 , ZFMP_OUT(zfstring &, ret)
139 , ZFMP_IN(const zfchar *, src)
143 , ZFMP_IN(const zfchar *, src)
152 , ZFMP_IN(const zfchar *, src)
156 , ZFMP_IN(const zfchar *, src)
158
159// ============================================================
164 , ZFMP_IN(const ZFPathInfo &, pathInfo)
165 , ZFMP_IN_OPT(const ZFOutput &, outputCallback, ZFOutputDefault())
166 , ZFMP_IN_OPT(const zfchar *, headToken, zfnull)
167 , ZFMP_IN_OPT(const zfchar *, indentToken, " ")
169
170// ============================================================
190 , ZFMP_IN(const ZFPathInfo &, pathInfo)
191 , ZFMP_IN(const ZFListener &, fileCallback)
192 , ZFMP_IN_OPT(zfbool, isRecursive, zftrue)
196 , ZFMP_IN(const ZFPathInfo &, pathInfo)
197 , ZFMP_IN(const ZFListener &, fileCallback)
198 , ZFMP_IN_OPT(zfbool, isRecursive, zftrue)
202 , ZFMP_IN(const ZFPathInfo &, pathInfo)
203 , ZFMP_IN(const ZFListener &, fileCallback)
204 , ZFMP_IN_OPT(zfbool, isRecursive, zftrue)
206
207// ============================================================
221 , ZFMP_IN(const ZFPathInfo &, srcPath)
222 , ZFMP_IN(const ZFPathInfo &, dstPath)
223 , ZFMP_IN_OPT(zfbool, isRecursive, zftrue)
224 , ZFMP_IN_OPT(zfbool, isForce, zftrue)
226
228#endif // #ifndef _ZFI_ZFIODef_util_h_
229
#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
#define zfnull
same as NULL, defined for future use
Definition ZFCoreTypeDef_CoreType.h:88
zft_zfstring< zfchar > zfstring
see zft_zfstring
Definition ZFCoreTypeDef_StringType.h:15
abstract IO
zfstring ZFFileNameOf(const zfchar *src)
see ZFFileNameOfT
zfbool ZFPathOfWithoutAllExtT(zfstring &ret, const zfchar *src)
get file path without all ext, e.g. "/path/file" from "/path/file.ext0.ext1", or original string if n...
zfbool ZFPathComponentsOfT(ZFCoreArray< zfstring > &ret, const zfchar *src)
get each file components from path or empty if error, e.g. {"path", "file.ext"}(as array) from "/path...
zfbool ZFPathOfWithoutExtT(zfstring &ret, const zfchar *src)
get file path without ext, e.g. "/path/file.ext0" from "/path/file.ext0.ext1", or original string if ...
zfbool ZFPathParentOfT(zfstring &ret, const zfchar *src)
get parent path
ZFCoreArray< zfstring > ZFPathComponentsOf(const zfchar *src)
see ZFPathComponentsOfT
zfstring ZFPathOfWithoutExt(const zfchar *src)
see ZFPathOfWithoutExtT
zfstring ZFFileExtOf(const zfchar *src)
see ZFFileExtOfT
zfstring ZFPathOfWithoutAllExt(const zfchar *src)
see ZFPathOfWithoutAllExtT
zfstring ZFPathParentOf(const zfchar *src)
see ZFPathParentOfT
zfbool ZFPathFormatRelativeT(zfstring &ret, const zfchar *src, zfindex srcLen=(((zfindex) -1)))
util method to resolve ".." in path
zfstring ZFPathFormatRelative(const zfchar *src, zfindex srcLen=(((zfindex) -1)))
see ZFPathFormatRelativeT
Definition ZFIODef_util.h:57
zfstring ZFPathFormat(const zfchar *src, zfindex srcLen=(((zfindex) -1)))
see ZFPathFormatT
Definition ZFIODef_util.h:39
zfbool ZFIOCopy(const ZFPathInfo &srcPath, const ZFPathInfo &dstPath, zfbool isRecursive=(_ZFT_t_zftrue), zfbool isForce=(_ZFT_t_zftrue))
copy a file or directory from srcPath to dstPath
zfbool ZFFileNameOfT(zfstring &ret, const zfchar *src)
get file name from path or src if error, e.g. "file.ext" from "/path/file.ext"
zfbool ZFFileExtOfT(zfstring &ret, const zfchar *src)
get file extension from path or empty if error, e.g. "ext1" from "/path/file.ext0....
zfbool ZFFileNameOfWithoutExtT(zfstring &ret, const zfchar *src)
get file name without extension from path or src if error, e.g. "file.ext0" from "/path/file....
zfbool ZFIOForEachDir(const ZFPathInfo &pathInfo, const ZFListener &fileCallback, zfbool isRecursive=(_ZFT_t_zftrue))
util method to loop each dir, see ZFIOForEach
zfbool ZFIOForEach(const ZFPathInfo &pathInfo, const ZFListener &fileCallback, zfbool isRecursive=(_ZFT_t_zftrue))
util method to loop each child file or dir in specified pathInfo
void ZFIOTreePrint(const ZFPathInfo &pathInfo, const ZFOutput &outputCallback=(ZFOutputDefault()), const zfchar *headToken=(zft_zfnull), const zfchar *indentToken=(" "))
list all files, usually for debug use
zfbool ZFIOForEachFile(const ZFPathInfo &pathInfo, const ZFListener &fileCallback, zfbool isRecursive=(_ZFT_t_zftrue))
util method to loop each file, see ZFIOForEach
zfbool ZFPathFormatT(zfstring &ret, const zfchar *src, zfindex srcLen=(((zfindex) -1)))
format path
zfstring ZFFileNameOfWithoutExt(const zfchar *src)
see ZFFileNameOfWithoutExtT
#define ZFMP_IN_OUT(ParamType, paramName)
see ZFMP_IN
Definition ZFMethod.h:117
#define ZFMP_OUT(ParamType, paramName)
see ZFMP_IN
Definition ZFMethod.h:111
#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_2(ZFLIB_, ReturnType, MethodName, ZFMP_0, ZFMP_1)
see ZFMETHOD_FUNC_DECLARE_0
Definition ZFMethodFuncDeclare.h:835
#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
const ZFOutput & ZFOutputDefault(void)
default output callback, output source must be zfchar *string
light weight array
Definition ZFCoreArray.h:331
listener as ZFCallback, mostly used by ZFObject::observerNotify
Definition ZFObjectObserver.h:30
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