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;
39
41 const zfchar *cString(void) const;
42
44 zfindex length(void) const;
45
47 zfint compare(ZF_IN const ZFSigName &ref) const;
48
50 zfint compare(ZF_IN const zfstring &s) const {
51 return ((const zfstring &)(*this)).compare(s);
52 }
53
55 zfint compare(ZF_IN const zfchar *s) const {
56 return zfscmp(this->cString(), s ? s : "");
57 }
58
59public:
60 operator const zfchar * (void) const {return this->cString();}
61 operator const zfstring & (void) const;
62public:
63 ZFSigName &operator = (ZF_IN const ZFSigName &ref);
64 ZFSigName &operator = (ZF_IN const zfstring &s);
65 ZFSigName &operator = (ZF_IN const zfchar *s);
66 ZFSigName &operator = (ZF_IN const zfnullT &dummy);
67public:
68 zfbool operator == (ZF_IN const ZFSigName &ref) const {return this->compare(ref) == 0;}
69 zfbool operator != (ZF_IN const ZFSigName &ref) const {return this->compare(ref) != 0;}
70 zfbool operator == (ZF_IN const zfstring &s) const {return this->compare(s) == 0;}
71 zfbool operator != (ZF_IN const zfstring &s) const {return this->compare(s) != 0;}
72 zfbool operator == (ZF_IN const zfchar *s) const {return this->compare(s) == 0;}
73 zfbool operator != (ZF_IN const zfchar *s) const {return this->compare(s) != 0;}
74 zfbool operator == (ZF_IN const zfnullT &dummy) const {return this->isEmpty();}
75 zfbool operator != (ZF_IN const zfnullT &dummy) const {return !this->isEmpty();}
76public:
77 /* ZFTAG_TRICKS: tricks to make ZFMap<ZFSigName, xxx> works */
78 inline zfbool operator < (ZF_IN const ZFSigName &ref) const {return this->compare(ref) < 0;}
79 inline zfbool operator <= (ZF_IN const ZFSigName &ref) const {return this->compare(ref) <= 0;}
80 inline zfbool operator > (ZF_IN const ZFSigName &ref) const {return this->compare(ref) > 0;}
81 inline zfbool operator >= (ZF_IN const ZFSigName &ref) const {return this->compare(ref) >= 0;}
83
84private:
85 _ZFP_ZFSigNamePrivate *d;
86};
87ZFOUTPUT_TYPE(ZFSigName, {s += v.cString();})
88ZFHASH_DECLARE(ZFSigName, {return zfidentityCalcString(v.cString(), v.length());})
89
98
100
101#endif // #ifndef _ZFI_ZFSigName_h_
102
#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:180
#define ZF_OUT
dummy macro that shows the param used as required output
Definition ZFCoreTypeDef_ClassType.h:188
#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:520
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
zfint compare(const zfchar *s) const
string comparation
Definition ZFSigName.h:55
zfidentity sigId(void) const
internal id for the string content
zfint compare(const zfstring &s) const
string comparation
Definition ZFSigName.h:50
zfindex length(void) const
length of string content
zfint compare(const ZFSigName &ref) const
string comparation