MCPcopy Create free account
hub / github.com/KebsCS/KBotExt / ImFormatStringToTempBuffer

Function ImFormatStringToTempBuffer

KBotExt/imgui/imgui.cpp:1902–1920  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1900#endif // #ifdef IMGUI_DISABLE_DEFAULT_FORMAT_FUNCTIONS
1901
1902void ImFormatStringToTempBuffer(const char** out_buf, const char** out_buf_end, const char* fmt, ...)
1903{
1904 ImGuiContext& g = *GImGui;
1905 va_list args;
1906 va_start(args, fmt);
1907 if (fmt[0] == '%' && fmt[1] == 's' && fmt[2] == 0)
1908 {
1909 const char* buf = va_arg(args, const char*); // Skip formatting when using "%s"
1910 *out_buf = buf;
1911 if (out_buf_end) { *out_buf_end = buf + strlen(buf); }
1912 }
1913 else
1914 {
1915 int buf_len = ImFormatStringV(g.TempBuffer.Data, g.TempBuffer.Size, fmt, args);
1916 *out_buf = g.TempBuffer.Data;
1917 if (out_buf_end) { *out_buf_end = g.TempBuffer.Data + buf_len; }
1918 }
1919 va_end(args);
1920}
1921
1922void ImFormatStringToTempBufferV(const char** out_buf, const char** out_buf_end, const char* fmt, va_list args)
1923{

Callers 1

BeginChildExMethod · 0.85

Calls 1

ImFormatStringVFunction · 0.85

Tested by

no test coverage detected