Extracts the actual name part of an enum instance In other words, it returns the Blue part of Bikeshed::Colour::Blue
| 4100 | // Extracts the actual name part of an enum instance |
| 4101 | // In other words, it returns the Blue part of Bikeshed::Colour::Blue |
| 4102 | StringRef extractInstanceName(StringRef enumInstance) { |
| 4103 | // Find last occurrence of ":" |
| 4104 | size_t name_start = enumInstance.size(); |
| 4105 | while (name_start > 0 && enumInstance[name_start - 1] != ':') { |
| 4106 | --name_start; |
| 4107 | } |
| 4108 | return enumInstance.substr(name_start, enumInstance.size() - name_start); |
| 4109 | } |
| 4110 | } |
| 4111 | |
| 4112 | std::vector<StringRef> parseEnums( StringRef enums ) { |
no test coverage detected