ZFFramework
 
Loading...
Searching...
No Matches
ZFIOUtil.h
Go to the documentation of this file.
1
5
6#ifndef _ZFI_ZFIOUtil_h_
7#define _ZFI_ZFIOUtil_h_
8
9#include "ZFAppUtilDef.h"
11
23 , ZFMP_IN(const ZFPathInfo &, pathInfo)
24 , ZFMP_IN_OPT(const ZFListener &, filter, zfnull)
26 )
27
28
40 , ZFMP_IN(const ZFPathInfo &, pathInfo)
41 , ZFMP_IN_OPT(const ZFListener &, filter, zfnull)
42 )
43
67 , ZFMP_IN(const ZFPathInfo &, pathInfo)
68 , ZFMP_IN(const ZFListener &, fileCallback)
69 , ZFMP_IN_OPT(const ZFListener &, finishCallback, zfnull)
70 , ZFMP_IN_OPT(zfbool, isRecursive, zftrue)
71 )
74 , ZFMP_IN(const ZFPathInfo &, pathInfo)
75 , ZFMP_IN(const ZFListener &, fileCallback)
76 , ZFMP_IN_OPT(const ZFListener &, finishCallback, zfnull)
77 , ZFMP_IN_OPT(zfbool, isRecursive, zftrue)
78 )
81 , ZFMP_IN(const ZFPathInfo &, pathInfo)
82 , ZFMP_IN(const ZFListener &, fileCallback)
83 , ZFMP_IN_OPT(const ZFListener &, finishCallback, zfnull)
84 , ZFMP_IN_OPT(zfbool, isRecursive, zftrue)
85 )
86
87// ============================================================
101 , ZFMP_IN(const ZFPathInfo &, pathInfo)
102 , ZFMP_IN_OPT(const ZFListener &, finishCallback, zfnull)
104
108zfclass ZFLIB_ZFAppUtil ZFStyleLoadAsyncTask : zfextend ZFTask {
109 ZFOBJECT_DECLARE(ZFStyleLoadAsyncTask, ZFTask)
110
111public:
116
117public:
122 , ZFMP_IN(const ZFPathInfo &, child)
134 , ZFMP_IN(ZFArray *, child)
136
137protected:
139 virtual void objectOnInit(void) {
141 }
142
144 ZFMP_IN(const ZFPathInfo &, child)
154protected:
156 virtual void taskOnStart(void);
158 virtual void taskOnStop(void);
159private:
160 zfautoT<ZFTaskId> _task;
161};
162
164#endif // #ifndef _ZFI_ZFIOUtil_h_
165
global header for ZFAppUtil module
#define ZFLIB_ZFAppUtil
used to export symbols
Definition ZFAppUtilDef.h:22
#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
_ZFT_t_zfbool zfbool
bool type
Definition ZFCoreTypeDef_CoreType.h:103
#define zftrue
bool true type
Definition ZFCoreTypeDef_CoreType.h:107
_zft_zftimet zftimet
time unit, ensured at least 64 bit, ensured signed
Definition ZFCoreTypeDef_CoreType.h:203
#define zfnull
same as NULL, defined for future use
Definition ZFCoreTypeDef_CoreType.h:88
zfautoT< ZFTaskId > ZFIOForEachAsync(const ZFPathInfo &pathInfo, const ZFListener &fileCallback, const ZFListener &finishCallback=(zft_zfnull), zfbool isRecursive=(_ZFT_t_zftrue))
async version for ZFIOForEach to prevent blocking UI update when performing heavy task
zfautoT< ZFTaskId > ZFIORemoveEmptyDir(const ZFPathInfo &pathInfo, const ZFListener &filter=(zft_zfnull))
remove empty dir, excluding the pathInfo itself
zfautoT< ZFTaskId > ZFIORemoveOutdate(const ZFPathInfo &pathInfo, const ZFListener &filter=(zft_zfnull), zftimet outdate=(zftimetOneWeek()))
remove outdated files
zfautoT< ZFTaskId > ZFIOForEachFileAsync(const ZFPathInfo &pathInfo, const ZFListener &fileCallback, const ZFListener &finishCallback=(zft_zfnull), zfbool isRecursive=(_ZFT_t_zftrue))
see ZFIOForEachAsync
zfautoT< ZFTaskId > ZFStyleLoadAsync(const ZFPathInfo &pathInfo, const ZFListener &finishCallback=(zft_zfnull))
async version of ZFStyleLoad
zfautoT< ZFTaskId > ZFIOForEachDirAsync(const ZFPathInfo &pathInfo, const ZFListener &fileCallback, const ZFListener &finishCallback=(zft_zfnull), zfbool isRecursive=(_ZFT_t_zftrue))
see ZFIOForEachAsync
#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_DECLARE_1(ReturnType, MethodName, ZFMP_0)
see ZFMethod
Definition ZFMethodDeclare.h:854
#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 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_ON_INIT_DECLARE_1(ZFMP_0)
see ZFOBJECT_ON_INIT_INLINE_1
Definition ZFObjectDeclare.h:263
#define ZFOBJECT_DECLARE(ChildClass, SuperClass,...)
necessary for every class inherit from ZFObject
Definition ZFObjectDeclare.h:126
#define ZFPROPERTY_RETAIN(Type, Name,...)
declare a retain property
Definition ZFPropertyDeclare.h:103
zftimet const & zftimetOneWeek(void)
in mili seconds
Definition ZFTime.h:571
container of ZFObject, see ZFContainer
Definition ZFArray.h:17
light weight array
Definition ZFCoreArray.h:342
listener as ZFCallback, mostly used by ZFObject::observerNotify
Definition ZFObjectObserver.h:30
path related info storage for impl, actual meaning of the info depends on impl
Definition ZFPathInfo.h:34
virtual void taskOnStop(void)
called to stop task
virtual zfanyT< ZFArray > const & taskList()
array of v_ZFPathInfo
Definition ZFIOUtil.h:115
virtual void child(const ZFPathInfo &child)
util to add task
virtual void objectOnInit(void)
override this to init your object
Definition ZFIOUtil.h:139
virtual void taskOnStart(void)
called to start task
virtual void objectOnInit(const ZFListener &implOnStart, const ZFListener &implOnStop=(zft_zfnull))
util constructor to attach custom impl to E_TaskOnStart and E_TaskOnStop
abstract task id
Definition ZFTaskId.h:16
see zfany
Definition zfany.h:113
type restrict version of zfauto
Definition zfautoFwd.h:108