MCPcopy Create free account
hub / github.com/Profactor/cv-plot / extractInstanceName

Function extractInstanceName

CvPlot/ext/catch2/inc/catch.hpp:10470–10477  ·  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

10468 // Extracts the actual name part of an enum instance
10469 // In other words, it returns the Blue part of Bikeshed::Colour::Blue
10470 StringRef extractInstanceName(StringRef enumInstance) {
10471 // Find last occurence of ":"
10472 size_t name_start = enumInstance.size();
10473 while (name_start > 0 && enumInstance[name_start - 1] != ':') {
10474 --name_start;
10475 }
10476 return enumInstance.substr(name_start, enumInstance.size() - name_start);
10477 }
10478 }
10479
10480 std::vector<StringRef> parseEnums( StringRef enums ) {

Callers 1

parseEnumsFunction · 0.85

Calls 2

sizeMethod · 0.80
substrMethod · 0.80

Tested by

no test coverage detected