#pragma once #include #include namespace bts { inline std::string uppercase_copy(const std::string &cs) { std::string s = cs; std::transform(s.begin(), s.end(), s.begin(), ::toupper); return s; } template std::optional parse_enum(const std::string &value, const std::string &prefix, T2 parse) { auto temp = value; T result; if (temp.find(prefix) == std::string::npos) { temp = prefix + "_" + temp; } if (parse(temp, &result)) { return {result}; } else { return std::nullopt; } } } // namespace bts