ZFFramework
Loading...
Searching...
No Matches
ZFSigName.h
Go to the documentation of this file.
1
5
6#ifndef _ZFI_ZFSigName_h_
7#define _ZFI_ZFSigName_h_
8
9#include "ZFCoreTypeDef.h"
10
12
13zfclassFwd _ZFP_ZFSigNamePrivate;
18public:
20 ZFSigName(void);
21 ZFSigName(ZF_IN const ZFSigName &ref);
22 ZFSigName(ZF_IN const zfstring &s);
23 ZFSigName(ZF_IN const zfchar *s);
24 ZFSigName(ZF_IN const zfnullT &dummy);
25 ~ZFSigName(void);
27
28public:
34 zfidentity sigId(void) const;
35
36public:
38 zfbool isEmpty(void) const;
40 zfbool isEqual(ZF_IN const ZFSigName &ref) const {
41 return ((const zfstring &)(*this)).isEqual((const zfstring &)ref);
42 }
43
44 zfbool isEqual(ZF_IN const zfstring &s) const {
45 return ((const zfstring &)(*this)).isEqual(s);
46 }
47
48 zfbool isEqual(ZF_IN const zfchar *s) const {
49 return ((const zfstring &)(*this)).isEqual(s);
50 }
51
53 const zfchar *cString(void) const;
54
56 zfindex length(void) const;
57
59 zfint compare(ZF_IN const ZFSigName &ref) const;
60
62 zfint compare(ZF_IN const zfstring &s) const {
63 return ((const zfstring &)(*this)).compare(s);
64 }
65
66 zfint compare(ZF_IN const zfchar *s) const {
67 return zfscmp(this->cString(), s ? s : "");
68 }
69
71public:
72 operator const zfchar * (void) const {return this->cString();}
73 operator const zfstring & (void) const;
74public:
75 ZFSigName &operator = (ZF_IN const ZFSigName &ref);
76 ZFSigName &operator = (ZF_IN const zfstring &s);
77 ZFSigName &operator = (ZF_IN const zfchar *s);
78 ZFSigName &operator = (ZF_IN const zfnullT &dummy);
79public:
80 zfbool operator == (ZF_IN const ZFSigName &ref) const {return this->isEqual(ref);}
81 zfbool operator != (ZF_IN const ZFSigName &ref) const {return !this->isEqual(ref);}
82 zfbool operator == (ZF_IN const zfstring &s) const {return this->isEqual(s);}
83 zfbool operator != (ZF_IN const zfstring &s) const {return !this->isEqual(s);}
84 zfbool operator == (ZF_IN const zfchar *s) const {return this->isEqual(s);}
85 zfbool operator != (ZF_IN const zfchar *s) const {return !this->isEqual(s);}
86 zfbool operator == (ZF_IN const zfnullT &dummy) const {return this->isEmpty();}
87 zfbool operator != (ZF_IN const zfnullT &dummy) const {return !this->isEmpty();}
88public:
89 /* ZFTAG_TRICKS: tricks to make zfstlmap<ZFSigName, xxx> works */
90 inline zfbool operator < (ZF_IN const ZFSigName &ref) const {return this->compare(ref) < 0;}
91 inline zfbool operator <= (ZF_IN const ZFSigName &ref) const {return this->compare(ref) <= 0;}
92 inline zfbool operator > (ZF_IN const ZFSigName &ref) const {return this->compare(ref) > 0;}
93 inline zfbool operator >= (ZF_IN const ZFSigName &ref) const {return this->compare(ref) >= 0;}
95
96private:
97 _ZFP_ZFSigNamePrivate *d;
98};
99ZFOUTPUT_TYPE(ZFSigName, {s += v.cString();})
100ZFHASH_DECLARE(ZFSigName, {return zfidentityCalcString(v.cString(), v.length());})
101
110
112
113#endif // #ifndef _ZFI_ZFSigName_h_
114
#define ZFLIB_ZFCore
used to export symbols
Definition ZFCoreEnvDef.h:30
types for ZFFramework
_ZFT_t_zfchar zfchar
char wrapper
Definition ZFCoreTypeDef_CharType.h:17
zfint zfscmp(const zfchar *s1, const zfchar *s2)
strcmp wrapper as zfchar type
Definition ZFCoreTypeDef_CharType.h:152
#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:191
#define ZF_OUT
dummy macro that shows the param used as required output
Definition ZFCoreTypeDef_ClassType.h:199
#define zfclassFwd
forward declaration of a class type
Definition ZFCoreTypeDef_ClassType.h:31
#define zfnullT
type for zfnull, can be used for function overload
Definition ZFCoreTypeDef_CoreType.h:85
_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
_ZFT_t_zfint zfint
same as int, see zfindex
Definition ZFCoreTypeDef_CoreType.h:165
_zft_zfidentity zfidentity
identity type, ensured at least 32 bit, ensured unsigned
Definition ZFCoreTypeDef_CoreType.h:225
#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 ZFHASH_DECLARE(Type, action)
see zftHash
Definition ZFCoreUtilTemplate.h:522
zfidentity zfidentityCalcString(const zfchar *src, zfindex srcLen=((zfindex) -1))
calculate identity from string
#define ZF_NAMESPACE_GLOBAL_BEGIN
begin namespace ZFFramework
Definition ZFNamespace.h:97
#define ZF_NAMESPACE_GLOBAL_END
end namespace ZFFramework
Definition ZFNamespace.h:98
void ZFSigNameInfoT(zfstring &ret)
print all state, for debug use only
zfstring ZFSigNameInfo(void)
print all state, for debug use only
zfstring ZFSigNameFromId(zfidentity sigId)
for debug use only
zfidentity ZFSigNameToId(const zfstring &name)
for debug use only
readonly string container for internal use only
Definition ZFSigName.h:17
zfbool isEmpty(void) const
whether empty
const zfchar * cString(void) const
access string value, return empty string if empty
zfbool isEqual(const zfchar *s) const
whether equal
Definition ZFSigName.h:48
zfint compare(const zfchar *s) const
string comparation
Definition ZFSigName.h:66
zfidentity sigId(void) const
internal id for the string content
zfint compare(const zfstring &s) const
string comparation
Definition ZFSigName.h:62
zfbool isEqual(const ZFSigName &ref) const
whether equal
Definition ZFSigName.h:40
zfbool isEqual(const zfstring &s) const
whether equal
Definition ZFSigName.h:44
zfindex length(void) const
length of string content
zfint compare(const ZFSigName &ref) const
string comparation