MCPcopy Create free account
hub / github.com/catchorg/Catch2 / extractInstanceName

Function extractInstanceName

extras/catch_amalgamated.cpp:4102–4109  ·  view source on GitHub ↗

Extracts the actual name part of an enum instance In other words, it returns the Blue part of Bikeshed::Colour::Blue

Source from the content-addressed store, hash-verified

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 ) {

Callers 1

parseEnumsFunction · 0.70

Calls 2

sizeMethod · 0.45
substrMethod · 0.45

Tested by

no test coverage detected