}
PlatformResult getName(NativeEnumType value, std::string* name) const {
+ if (nullptr == name) {
+ return PlatformResult(ErrorCode::INVALID_VALUES_ERR, "output argument cannnot be nullptr");
+ }
+
auto it = rev_mapping_.find(value);
if (it != rev_mapping_.end()) {
*name = it->second;
return PlatformResult(ErrorCode::NO_ERROR);
}
+
return PlatformResult(ErrorCode::INVALID_VALUES_ERR, "enum value not registered");
}
PlatformResult getValue(std::string name, NativeEnumType* value) const {
+ if (nullptr == value) {
+ return PlatformResult(ErrorCode::INVALID_VALUES_ERR, "output argument cannnot be nullptr");
+ }
+
auto it = mapping_.find(name);
if (it != mapping_.end()) {
*value = it->second;