ZFFramework
 
Loading...
Searching...
No Matches
ZFFile_fwd.h
Go to the documentation of this file.
1
5
6#ifndef _ZFI_ZFFile_fwd_h_
7#define _ZFI_ZFFile_fwd_h_
8
9#include "ZFObject.h"
11
12// ============================================================
13// ZFFileOpenOption
35 ZFENUM_VALUE_WITH_INIT(Create, 1 << 0)
37 ZFENUM_VALUE_WITH_INIT(Write, 1 << 2)
38 ZFENUM_VALUE_WITH_INIT(Append, 1 << 3)
46
47// ============================================================
48zfclassFwd _ZFP_ZFFileFindDataPrivate;
54public:
56 ZFFileFindData(void);
58 ZFFileFindData &operator = (ZF_IN ZFFileFindData const &ref);
59 zfbool operator == (ZF_IN ZFFileFindData const &ref) const;
60 zfbool operator != (ZF_IN ZFFileFindData const &ref) const {
61 return !this->operator == (ref);
62 }
64 ~ZFFileFindData(void);
65
66public:
70 const zfstring &name(void) const {
71 return this->impl().name;
72 }
73
76 zfbool isDir(void) const {
77 return this->impl().isDir;
78 }
79
80public:
82 void objectInfoT(ZF_IN_OUT zfstring &ret) const;
84 inline zfstring objectInfo(void) const {
85 zfstring ret;
86 this->objectInfoT(ret);
87 return ret;
88 }
89
90public:
93 public:
96 void *nativeFd;
97 public:
99 Impl(void)
100 : name()
101 , isDir(zffalse)
103 {
104 }
106 private:
107 Impl(ZF_IN const Impl &);
108 Impl &operator = (ZF_IN const Impl &);
109 };
110public:
112 Impl &impl(void) const;
114 void implCopy(ZF_IN const ZFFileFindData &ref) const;
116 const zfstring &implName(void) const;
118 void *implUserData(void) const;
121 ZF_IN const zfstring &implName
123 );
125 void implDetach(void);
127 void *implCheck(ZF_IN const zfstring &implName) const;
128
131 ZF_IN const zfstring &key
132 , ZF_IN ZFObject *value
133 ) const;
135 zfany implTag(ZF_IN const zfstring &key) const;
136private:
137 _ZFP_ZFFileFindDataPrivate *d;
138};
141ZFOUTPUT_TYPE(ZFFileFindData, {v.objectInfoT(s);})
142
143// ============================================================
150
152#endif // #ifndef _ZFI_ZFFile_fwd_h_
153
#define ZFLIB_ZFCore
used to export symbols
Definition ZFCoreEnvDef.h:30
#define zffinal
dummy macro shows that a method or class is designed must not to be overrided
Definition ZFCoreTypeDef_ClassType.h:63
#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
#define ZF_IN_OPT
dummy macro that shows the param used as optional input
Definition ZFCoreTypeDef_ClassType.h:184
#define zfclassNotPOD
shows the class is not a POD type, you should not memset it or declare it in stack or copy value by c...
Definition ZFCoreTypeDef_ClassType.h:48
#define ZF_IN_OUT
dummy macro that shows the param used as required input and output
Definition ZFCoreTypeDef_ClassType.h:196
#define zfclassFwd
forward declaration of a class type
Definition ZFCoreTypeDef_ClassType.h:31
_ZFT_t_zfbool zfbool
bool type
Definition ZFCoreTypeDef_CoreType.h:103
#define zffalse
bool false type
Definition ZFCoreTypeDef_CoreType.h:111
#define zfnull
same as NULL, defined for future use
Definition ZFCoreTypeDef_CoreType.h:88
#define ZFOUTPUT_TYPE(T_Type, outputAction)
declare your custom type conversion to string, convenient for debug
Definition ZFCoreTypeDef_OtherType.h:221
zft_zfstring< zfchar > zfstring
see zft_zfstring
Definition ZFCoreTypeDef_StringType.h:15
#define ZFENUM_REG_FLAGS(ZFLIB_, EnumName, EnumFlagsName,...)
see ZFENUM_BEGIN
Definition ZFEnumDeclare.h:189
#define ZFENUM_SEPARATOR()
see ZFENUM_BEGIN
Definition ZFEnumDeclare.h:158
#define ZFENUM_VALUE_REGISTER(Value)
see ZFENUM_BEGIN
Definition ZFEnumDeclare.h:168
#define ZFENUM_VALUE_WITH_INIT(Value, initValue)
see ZFENUM_BEGIN
Definition ZFEnumDeclare.h:154
#define ZFENUM_BEGIN(ZFLIB_, EnumName)
macros to define reflectable enum type
Definition ZFEnumDeclare.h:147
#define ZFENUM_END_FLAGS(ZFLIB_, EnumName, EnumFlagsName)
see ZFENUM_BEGIN
Definition ZFEnumDeclare.h:179
v_ZFFileOpenOption::ZFEnumType ZFFileOpenOption
see v_ZFFileOpenOption
Definition ZFFile_fwd.h:44
#define ZFSerializableKeyword_ZFFileCallback_localPath
keyword for serialize
Definition ZFFile_fwd.h:149
#define ZFSerializableKeyword_ZFFileCallback_flags
keyword for serialize
Definition ZFFile_fwd.h:147
#define ZFSerializableKeyword_ZFFileCallback_pathInfo
keyword for serialize
Definition ZFFile_fwd.h:145
#define ZF_NAMESPACE_GLOBAL_BEGIN
begin namespace ZFFramework
Definition ZFNamespace.h:97
#define ZF_NAMESPACE_GLOBAL_END
end namespace ZFFramework
Definition ZFNamespace.h:98
ZFObject related include.
#define ZFTYPEID_ACCESS_ONLY_REG(ZFLIB_, TypeName, Type,...)
see ZFTYPEID_DECLARE
Definition ZFTypeIdDeclare.h:205
#define ZFTYPEID_ACCESS_ONLY_DECLARE(ZFLIB_, TypeName, Type)
see ZFTYPEID_DECLARE
Definition ZFTypeIdDeclare.h:195
for impl to achieve custom find logic
Definition ZFFile_fwd.h:92
zfstring name
file path
Definition ZFFile_fwd.h:94
zfbool isDir
whether directory
Definition ZFFile_fwd.h:95
void * nativeFd
for impl to store native find data
Definition ZFFile_fwd.h:96
data used by ZFFile when finding files
Definition ZFFile_fwd.h:53
void implTag(const zfstring &key, ZFObject *value) const
util for impl to store extra data
void implCopy(const ZFFileFindData &ref) const
copy the impl data
void implDetach(void)
close find
zfbool isDir(void) const
return true if is a directory
Definition ZFFile_fwd.h:76
void * implUserData(void) const
user data passed from implAttach
void objectInfoT(zfstring &ret) const
see objectInfo
zfstring objectInfo(void) const
return object info
Definition ZFFile_fwd.h:84
Impl & impl(void) const
the impl
void implAttach(const zfstring &implName, void *implUserData=zft_zfnull)
begin first find
zfany implTag(const zfstring &key) const
util for impl to store extra data
const zfstring & name(void) const
return file name of file
Definition ZFFile_fwd.h:70
void * implCheck(const zfstring &implName) const
check whether impl matches, assert fail if not match, return the implUserData
const zfstring & implName(void) const
name for the impl
see v_ZFFileOpenOption, ZFFileOpenOptionFlagsToString, ZFFileOpenOptionFlagsFromString
Definition ZFFile_fwd.h:44
base class of all objects
Definition ZFObjectCore.h:209
util method to cast ZFObject types freely
Definition zfany.h:35