MCPcopy Create free account
hub / github.com/InteractiveComputerGraphics/SPlisHSPlasH / extractInstanceName

Function extractInstanceName

extern/Catch2/catch.hpp:10592–10599  ·  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

10590 // Extracts the actual name part of an enum instance
10591 // In other words, it returns the Blue part of Bikeshed::Colour::Blue
10592 StringRef extractInstanceName(StringRef enumInstance) {
10593 // Find last occurrence of ":"
10594 size_t name_start = enumInstance.size();
10595 while (name_start > 0 && enumInstance[name_start - 1] != ':') {
10596 --name_start;
10597 }
10598 return enumInstance.substr(name_start, enumInstance.size() - name_start);
10599 }
10600 }
10601
10602 std::vector<StringRef> parseEnums( StringRef enums ) {

Callers 1

parseEnumsFunction · 0.85

Calls 2

substrMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected