You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
764 B
31 lines
764 B
#pragma once
|
|
#include <stdint.h>
|
|
#include <string.h>
|
|
|
|
namespace iflytop {
|
|
class ZEnum {
|
|
public:
|
|
int val;
|
|
char const* name;
|
|
char const* 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 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;
|
|
}
|
|
};
|
|
|
|
} // namespace iflytop
|