|
|
@ -5,27 +5,18 @@ |
|
|
|
namespace iflytop { |
|
|
|
class ZEnum { |
|
|
|
public: |
|
|
|
int val; |
|
|
|
char const* name; |
|
|
|
char const* chName; |
|
|
|
const int val; |
|
|
|
const char* name; |
|
|
|
const char* chName; |
|
|
|
|
|
|
|
ZEnum(int val, const char* name, const char* chName) : val(val), name(name), chName(chName) {} |
|
|
|
|
|
|
|
bool isEq(int val) { return this->val == val; } |
|
|
|
bool isEq(ZEnum* role) { return this->val == role->val; } |
|
|
|
bool isEq(int val) const { return this->val == val; } |
|
|
|
bool isEq(const ZEnum& role) const { return this->val == role.val; } |
|
|
|
bool isEqByChName(const char* chName) { return strcmp(this->chName, chName) == 0; } |
|
|
|
|
|
|
|
ZEnum(const ZEnum& other) : val(other.val), name(other.name), chName(other.chName) {} |
|
|
|
|
|
|
|
// :operator=
|
|
|
|
ZEnum& operator=(const ZEnum& other) { |
|
|
|
if (this != &other) { |
|
|
|
val = other.val; |
|
|
|
name = other.name; |
|
|
|
chName = other.chName; |
|
|
|
} |
|
|
|
return *this; |
|
|
|
} |
|
|
|
// ʵÏÖ¿½±´¹¹Ô캯Êý
|
|
|
|
ZEnum(const ZEnum& role) : val(role.val), name(role.name), chName(role.chName) {} |
|
|
|
}; |
|
|
|
|
|
|
|
} // namespace iflytop
|