[*] Fix kName ->k ## name
This commit is contained in:
parent
fcd9d35fac
commit
a9327e719c
@ -69,8 +69,8 @@ using AuUInt = size_t;
|
||||
|
||||
#define AUE_DEFINE(name, vals) enum class name { AU_FOR_EACH(AUE_EMIT_ARRAY, AUE_STRIP_BRACKETS(vals)) kEnumCount }; \
|
||||
static inline const AuString k ## name ## ToString[static_cast<int>(name::kEnumCount)] = {AU_FOR_EACH_FIRST(AUE_EMIT_A, AUE_EMIT_B, AUE_STRIP_BRACKETS(vals)) }; \
|
||||
inline const AuHashMap<AuString, name> k ## Name ## FromString = { AU_FOR_EACH_THAT(AUE_EMIT_PAIRNAME, name, AUE_STRIP_BRACKETS(vals)) {"kEnumCount", name::kEnumCount} }; \
|
||||
inline const AuHashMap<AuString, name> k ## name ## FromString = { AU_FOR_EACH_THAT(AUE_EMIT_PAIRNAME, name, AUE_STRIP_BRACKETS(vals)) {"kEnumCount", name::kEnumCount} }; \
|
||||
static inline name name ## FromString (const AuString &codename) { AU_FOR_EACH_THAT(AUE_EMIT_CHECK, name, AUE_STRIP_BRACKETS(vals)) return name::kEnumCount; } \
|
||||
static inline name name ## FromHashString(const AuString &codename) { auto itr = k ## Name ## FromString.find(codename); if (itr == k ## Name ## FromString.end()) return name::kEnumCount; return itr->second; } \
|
||||
static inline name name ## FromHashString(const AuString &codename) { auto itr = k ## name ## FromString.find(codename); if (itr == k ## name ## FromString.end()) return name::kEnumCount; return itr->second; } \
|
||||
static inline const AuString & name ## ToString(name val) { static const AuString invalid = "kEnumCount"; if (static_cast<AuUInt>(val) >= static_cast<int>(name::kEnumCount)) return invalid; return k ## name ## ToString[static_cast<AuUInt>(val)]; } \
|
||||
static inline void name ## ForEach(const AuConsumer<name> &consumer) { AU_FOR_EACH_THAT(AUE_EMIT_CALL, name, AUE_STRIP_BRACKETS(vals)) }
|
Loading…
Reference in New Issue
Block a user