6#ifndef _ZFI_ZFFile_util_h_
7#define _ZFI_ZFFile_util_h_
163 _ZFP_ZFFileCloseHolder(
ZF_IN void *token) : token(token) {}
164 ~_ZFP_ZFFileCloseHolder(
void) {
165 if(this->token !=
zfnull) {
175#define ZFFileCloseHolder(token) _ZFP_ZFFileCloseHolder ZFUniqueName(ZFFileCloseHolder)(token)
180 _ZFP_ZFResCloseHolder(
ZF_IN void *token) : token(token) {}
181 ~_ZFP_ZFResCloseHolder(
void) {
182 if(this->token !=
zfnull) {
192#define ZFResCloseHolder(token) _ZFP_ZFResCloseHolder ZFUniqueName(ZFResCloseHolder)(token)
197 _ZFP_ZFPathInfoCloseHolder(
205 ~_ZFP_ZFPathInfoCloseHolder(
void) {
206 if(this->token !=
zfnull) {
217#define ZFPathInfoCloseHolder(pathInfo, token) _ZFP_ZFPathInfoCloseHolder ZFUniqueName(ZFPathInfoCloseHolder)(pathInfo, token)
#define ZFLIB_ZFCore
used to export symbols
Definition ZFCoreEnvDef.h:30
_ZFT_t_zfchar zfchar
char wrapper
Definition ZFCoreTypeDef_CharType.h:17
#define zfclassLikePOD
shows the class is not a POD type, but you may use it like a POD except memset it to 0
Definition ZFCoreTypeDef_ClassType.h:41
#define ZF_IN
dummy macro that shows the param used as required input
Definition ZFCoreTypeDef_ClassType.h:180
_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
zfbool ZFFileClose(void *token)
close and save the file if need, return false if save failed
zfbool ZFPathInfoClose(const ZFPathInfo &pathInfo, void *token)
see ZFPATHTYPE_FILEIO_REGISTER
zfbool ZFResClose(void *token)
see ZFResOpen ZFFileClose
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 ZFPathInfoForEach(const ZFPathInfo &pathInfo, const ZFListener &fileCallback, zfbool isRecursive=(_ZFT_t_zftrue))
util method to loop each child file or dir in specified pathInfo
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
void ZFPathInfoTreePrint(const ZFPathInfo &pathInfo, const ZFOutput &outputCallback=(ZFOutputDefault()), const zfchar *headToken=(zft_zfnull), const zfchar *indentToken=(" "))
list all files, usually for debug use
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 ZFFile_util.h:58
zfstring ZFPathFormat(const zfchar *src, zfindex srcLen=(((zfindex) -1)))
see ZFPathFormatT
Definition ZFFile_util.h:40
zfbool ZFPathInfoForEachDir(const ZFPathInfo &pathInfo, const ZFListener &fileCallback, zfbool isRecursive=(_ZFT_t_zftrue))
util method to loop each dir, see ZFPathInfoForEach
zfbool ZFPathInfoForEachFile(const ZFPathInfo &pathInfo, const ZFListener &fileCallback, zfbool isRecursive=(_ZFT_t_zftrue))
util method to loop each file, see ZFPathInfoForEach
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 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:35