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

Function CppCondition

Tools/etw_list/etw_list.cpp:553–579  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

551}
552
553std::wstring CppCondition(std::wstring s)
554{
555 auto n = s.length();
556 if (n > 0) {
557 // Add _ if first character is a number
558 size_t i = 0;
559 if (isdigit(s[i])) {
560 s.insert(s.begin(), '_');
561 i += 1;
562 }
563
564 // Convert bad characters into _
565 for ( ; i < n; ++i) {
566 if (s[i] == L' ' ||
567 s[i] == L'-' ||
568 s[i] == L'/' ||
569 s[i] == L':' ||
570 s[i] == L'.' ||
571 s[i] == L',' ||
572 s[i] == L'(' ||
573 s[i] == L')') {
574 s[i] = L'_';
575 }
576 }
577 }
578 return s;
579}
580
581std::wstring GetMemberStructName(std::wstring const& name, size_t memberIndex)
582{

Callers 3

PrintCppStructFunction · 0.85
PrintEnumFunction · 0.85
wmainFunction · 0.85

Calls 1

beginMethod · 0.45

Tested by

no test coverage detected