ZFFramework
 
Loading...
Searching...
No Matches
ZFToken.h
Go to the documentation of this file.
1
5
6#ifndef _ZFI_ZFToken_h_
7#define _ZFI_ZFToken_h_
8
9#include "ZFCoreTypeDef.h"
10
12
13// ============================================================
18public:
25
26public:
29 : tokenLeft("[")
30 , tokenRight("]")
31 , tokenSeparator(", ")
32 , tokenValueLeft("")
33 , tokenValueRight("")
34 , tokenEtc("...")
35 {
36 }
38 ZF_IN zfstring const &tokenLeft
39 , ZF_IN zfstring const &tokenRight
40 , ZF_IN zfstring const &tokenSeparator
41 , ZF_IN zfstring const &tokenValueLeft
42 , ZF_IN zfstring const &tokenValueRight
43 , ZF_IN zfstring const &tokenEtc
44 )
45 : tokenLeft(tokenLeft)
46 , tokenRight(tokenRight)
47 , tokenSeparator(tokenSeparator)
48 , tokenValueLeft(tokenValueLeft)
49 , tokenValueRight(tokenValueRight)
50 , tokenEtc(tokenEtc)
51 {
52 }
53 zfbool operator == (ZF_IN const ZFTokenForContainer &ref) const {
54 return (this->tokenLeft.compare(ref.tokenLeft) == 0
55 && this->tokenRight.compare(ref.tokenRight) == 0
56 && this->tokenSeparator.compare(ref.tokenSeparator) == 0
57 && this->tokenValueLeft.compare(ref.tokenValueLeft) == 0
58 && this->tokenValueRight.compare(ref.tokenValueRight) == 0
59 && this->tokenEtc.compare(ref.tokenEtc) == 0
60 );
61 }
62 inline zfbool operator != (ZF_IN const ZFTokenForContainer &ref) const {return !this->operator == (ref);}
64};
65extern ZFLIB_ZFCore const ZFTokenForContainer _ZFP_ZFTokenForContainerTrim;
66extern ZFLIB_ZFCore const ZFTokenForContainer _ZFP_ZFTokenForContainerDetail;
67extern ZFLIB_ZFCore const ZFTokenForContainer _ZFP_ZFTokenForContainerPlainList;
68extern ZFLIB_ZFCore ZFTokenForContainer _ZFP_ZFTokenForContainerDefault;
77#define ZFTokenForContainerTrim() _ZFP_ZFTokenForContainerTrim
91#define ZFTokenForContainerDetail() _ZFP_ZFTokenForContainerDetail
103#define ZFTokenForContainerPlainList() _ZFP_ZFTokenForContainerPlainList
107#define ZFTokenForContainerDefault() _ZFP_ZFTokenForContainerDefault
108
109// ============================================================
114public:
126
127public:
130 : tokenLeft("{")
131 , tokenRight("}")
132 , tokenSeparator(", ")
133 , tokenPairLeft("")
134 , tokenPairRight("")
135 , tokenPairSeparator(" = ")
136 , tokenKeyLeft("")
137 , tokenKeyRight("")
138 , tokenValueLeft("")
139 , tokenValueRight("")
140 , tokenEtc("...")
141 {
142 }
144 ZF_IN zfstring const &tokenLeft
145 , ZF_IN zfstring const &tokenRight
146 , ZF_IN zfstring const &tokenSeparator
147 , ZF_IN zfstring const &tokenPairLeft
148 , ZF_IN zfstring const &tokenPairRight
149 , ZF_IN zfstring const &tokenPairSeparator
150 , ZF_IN zfstring const &tokenKeyLeft
151 , ZF_IN zfstring const &tokenKeyRight
152 , ZF_IN zfstring const &tokenValueLeft
153 , ZF_IN zfstring const &tokenValueRight
154 , ZF_IN zfstring const &tokenEtc
155 )
156 : tokenLeft(tokenLeft)
157 , tokenRight(tokenRight)
158 , tokenSeparator(tokenSeparator)
159 , tokenPairLeft(tokenPairLeft)
160 , tokenPairRight(tokenPairRight)
161 , tokenPairSeparator(tokenPairSeparator)
162 , tokenKeyLeft(tokenKeyLeft)
163 , tokenKeyRight(tokenKeyRight)
164 , tokenValueLeft(tokenValueLeft)
165 , tokenValueRight(tokenValueRight)
166 , tokenEtc(tokenEtc)
167 {
168 }
169 zfbool operator == (ZF_IN const ZFTokenForKeyValueContainer &ref) const {
170 return (this->tokenLeft.compare(ref.tokenLeft) == 0
171 && this->tokenRight.compare(ref.tokenRight) == 0
172 && this->tokenSeparator.compare(ref.tokenSeparator) == 0
173 && this->tokenPairLeft.compare(ref.tokenPairLeft) == 0
174 && this->tokenPairRight.compare(ref.tokenPairRight) == 0
175 && this->tokenPairSeparator.compare(ref.tokenPairSeparator) == 0
176 && this->tokenKeyLeft.compare(ref.tokenKeyLeft) == 0
177 && this->tokenKeyRight.compare(ref.tokenKeyRight) == 0
178 && this->tokenValueLeft.compare(ref.tokenValueLeft) == 0
179 && this->tokenValueRight.compare(ref.tokenValueRight) == 0
180 && this->tokenEtc.compare(ref.tokenEtc) == 0
181 );
182 }
183 inline zfbool operator != (ZF_IN const ZFTokenForKeyValueContainer &ref) const {return !this->operator == (ref);}
185};
186extern ZFLIB_ZFCore const ZFTokenForKeyValueContainer _ZFP_ZFTokenForKeyValueContainerTrim;
187extern ZFLIB_ZFCore const ZFTokenForKeyValueContainer _ZFP_ZFTokenForKeyValueContainerDetail;
188extern ZFLIB_ZFCore ZFTokenForKeyValueContainer _ZFP_ZFTokenForKeyValueContainerDefault;
197#define ZFTokenForKeyValueContainerTrim() _ZFP_ZFTokenForKeyValueContainerTrim
210#define ZFTokenForKeyValueContainerDetail() _ZFP_ZFTokenForKeyValueContainerDetail
214#define ZFTokenForKeyValueContainerDefault() _ZFP_ZFTokenForKeyValueContainerDefault
215
217
218#endif // #ifndef _ZFI_ZFToken_h_
219
#define ZFLIB_ZFCore
used to export symbols
Definition ZFCoreEnvDef.h:30
types for ZFFramework
#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_zfstring< zfchar > zfstring
see zft_zfstring
Definition ZFCoreTypeDef_StringType.h:15
#define ZF_NAMESPACE_GLOBAL_BEGIN
begin namespace ZFFramework
Definition ZFNamespace.h:97
#define ZF_NAMESPACE_GLOBAL_END
end namespace ZFFramework
Definition ZFNamespace.h:98
util class to hold string tokens
Definition ZFToken.h:17
zfstring tokenLeft
"[" by default
Definition ZFToken.h:19
zfstring tokenValueLeft
"" by default
Definition ZFToken.h:22
zfstring tokenRight
"]" by default
Definition ZFToken.h:20
zfstring tokenSeparator
", " by default
Definition ZFToken.h:21
zfstring tokenValueRight
"" by default
Definition ZFToken.h:23
zfstring tokenEtc
"..." by default
Definition ZFToken.h:24
util class to hold string tokens
Definition ZFToken.h:113
zfstring tokenLeft
"{" by default
Definition ZFToken.h:115
zfstring tokenSeparator
", " by default
Definition ZFToken.h:117
zfstring tokenValueRight
"" by default
Definition ZFToken.h:124
zfstring tokenValueLeft
"" by default
Definition ZFToken.h:123
zfstring tokenKeyLeft
"" by default
Definition ZFToken.h:121
zfstring tokenRight
"}" by default
Definition ZFToken.h:116
zfstring tokenPairSeparator
" = " by default
Definition ZFToken.h:120
zfstring tokenEtc
"..." by default
Definition ZFToken.h:125
zfstring tokenPairLeft
"" by default
Definition ZFToken.h:118
zfstring tokenPairRight
"" by default
Definition ZFToken.h:119
zfstring tokenKeyRight
"" by default
Definition ZFToken.h:122
zfint compare(const zft_zfstring< T_Char > &s) const
compare with another string
Definition zfstring.h:535