blob: 56ea88dbff6c2b474fd42064dabbe4d07765f578 [file] [log] [blame]
Krzysztof Grobelnycff70c12022-10-27 07:16:08 +00001#pragma once
2
3#include <string_view>
4
5namespace utils
6{
7
8inline std::string_view toShortEnum(std::string_view name)
9{
10 auto pos = name.find_last_of(".");
11 if (pos != std::string_view::npos && pos + 1 < name.size())
12 {
13 return name.substr(pos + 1);
14 }
15 return name;
16}
17
18} // namespace utils