MCPcopy Create free account
hub / github.com/RenderKit/embree / ImParseFormatFindEnd

Function ImParseFormatFindEnd

tutorials/common/imgui/imgui_widgets.cpp:3184–3199  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3182}
3183
3184const char* ImParseFormatFindEnd(const char* fmt)
3185{
3186 // Printf/scanf types modifiers: I/L/h/j/l/t/w/z. Other uppercase letters qualify as types aka end of the format.
3187 if (fmt[0] != '%')
3188 return fmt;
3189 const unsigned int ignored_uppercase_mask = (1 << ('I'-'A')) | (1 << ('L'-'A'));
3190 const unsigned int ignored_lowercase_mask = (1 << ('h'-'a')) | (1 << ('j'-'a')) | (1 << ('l'-'a')) | (1 << ('t'-'a')) | (1 << ('w'-'a')) | (1 << ('z'-'a'));
3191 for (char c; (c = *fmt) != 0; fmt++)
3192 {
3193 if (c >= 'A' && c <= 'Z' && ((1 << (c - 'A')) & ignored_uppercase_mask) == 0)
3194 return fmt + 1;
3195 if (c >= 'a' && c <= 'z' && ((1 << (c - 'a')) & ignored_lowercase_mask) == 0)
3196 return fmt + 1;
3197 }
3198 return fmt;
3199}
3200
3201// Extract the format out of a format string with leading or trailing decorations
3202// fmt = "blah blah" -> return fmt

Calls

no outgoing calls

Tested by

no test coverage detected