| Krzysztof Grobelny | cff70c1 | 2022-10-27 07:16:08 +0000 | [diff] [blame] | 1 | #pragma once |
| 2 | |||||
| 3 | #include <string_view> | ||||
| 4 | |||||
| 5 | namespace utils | ||||
| 6 | { | ||||
| 7 | |||||
| 8 | inline 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 | ||||