Add types for audio alerts

This commit is contained in:
Dan Paulat 2023-11-29 06:00:30 -06:00
parent e1ccc1ebb8
commit 9486d2364a
7 changed files with 97 additions and 1 deletions

View file

@ -0,0 +1,20 @@
#pragma once
#define SCWX_GET_ENUM(Type, FunctionName, nameMap) \
Type FunctionName(const std::string& name) \
{ \
auto result = \
std::find_if(nameMap.cbegin(), \
nameMap.cend(), \
[&](const std::pair<Type, std::string>& pair) -> bool \
{ return boost::iequals(pair.second, name); }); \
\
if (result != nameMap.cend()) \
{ \
return result->first; \
} \
else \
{ \
return Type::Unknown; \
} \
}