* Added case less check for enum names
* Added <algorithm> header
#pragma once
+#include <algorithm>
#include <string>
#include <utility>
/// Converts strings to enum values
static EnumType as_enum(const std::string& name)
{
+ auto to_lower = [](const std::string& s)
+ {
+ std::string rc = s;
+ std::transform(rc.begin(), rc.end(), rc.begin(), ::tolower);
+ return rc;
+ };
for (auto p : get().m_string_enums)
{
- if (p.first == name)
+ if (to_lower(p.first) == to_lower(name))
{
return p.second;
}