MCPcopy Create free account
hub / github.com/TheForceEngine/TheForceEngine / append

Method append

TheForceEngine/TFE_Ui/imGUI/imgui.cpp:2786–2802  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2784char ImGuiTextBuffer::EmptyString[1] = { 0 };
2785
2786void ImGuiTextBuffer::append(const char* str, const char* str_end)
2787{
2788 int len = str_end ? (int)(str_end - str) : (int)strlen(str);
2789
2790 // Add zero-terminator the first time
2791 const int write_off = (Buf.Size != 0) ? Buf.Size : 1;
2792 const int needed_sz = write_off + len;
2793 if (write_off + len >= Buf.Capacity)
2794 {
2795 int new_capacity = Buf.Capacity * 2;
2796 Buf.reserve(needed_sz > new_capacity ? needed_sz : new_capacity);
2797 }
2798
2799 Buf.resize(needed_sz);
2800 memcpy(&Buf[write_off - 1], str, (size_t)len);
2801 Buf[write_off - 1 + len] = 0;
2802}
2803
2804void ImGuiTextBuffer::appendf(const char* fmt, ...)
2805{

Callers 8

TableSetupColumnMethod · 0.80
DebugLogVMethod · 0.80
TabItemExMethod · 0.80
ExtractMetadataMethod · 0.80
ExtractDeclarationMethod · 0.80
exportSelectionToTextFunction · 0.80

Calls 4

ImMaxFunction · 0.85
reserveMethod · 0.80
push_backMethod · 0.80
resizeMethod · 0.45

Tested by

no test coverage detected