MCPcopy Create free account
hub / github.com/GameTechDev/PresentMon / FindHeader

Function FindHeader

Tests/PresentMon.cpp:76–94  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

74}
75
76PresentMonCsv::Header FindHeader(char const* header)
77{
78 for (uint32_t i = 0; i < PresentMonCsv::KnownHeaderCount; ++i) {
79 auto h = (PresentMonCsv::Header) i;
80 // do a case insensitive compare to see if the header starts with "ms"
81
82 std::string headerName = PresentMonCsv::GetHeaderString(h);
83 if (std::tolower(headerName[0]) == 'm' && std::tolower(headerName[1]) == 's') {
84 if (CaseInsensitiveCompare(header, headerName)) {
85 return h;
86 }
87 } else {
88 if (strcmp(header, PresentMonCsv::GetHeaderString(h)) == 0) {
89 return h;
90 }
91 }
92 }
93 return PresentMonCsv::UnknownHeader;
94}
95
96}
97

Callers 4

OpenMethod · 0.85
GetColumnIndexMethod · 0.85
OpenMethod · 0.85
GetColumnIndexMethod · 0.85

Calls 2

GetHeaderStringFunction · 0.85
CaseInsensitiveCompareFunction · 0.70

Tested by

no test coverage detected