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

Method append

KBotExt/imgui/imgui.cpp:2607–2623  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2605char ImGuiTextBuffer::EmptyString[1] = { 0 };
2606
2607void ImGuiTextBuffer::append(const char* str, const char* str_end)
2608{
2609 int len = str_end ? (int)(str_end - str) : (int)strlen(str);
2610
2611 // Add zero-terminator the first time
2612 const int write_off = (Buf.Size != 0) ? Buf.Size : 1;
2613 const int needed_sz = write_off + len;
2614 if (write_off + len >= Buf.Capacity)
2615 {
2616 int new_capacity = Buf.Capacity * 2;
2617 Buf.reserve(needed_sz > new_capacity ? needed_sz : new_capacity);
2618 }
2619
2620 Buf.resize(needed_sz);
2621 memcpy(&Buf[write_off - 1], str, (size_t)len);
2622 Buf[write_off - 1 + len] = 0;
2623}
2624
2625void ImGuiTextBuffer::appendf(const char* fmt, ...)
2626{

Callers 11

RenderMethod · 0.80
ChangeRunesOpggMethod · 0.80
RenderMethod · 0.80
SaveMethod · 0.80
RenderMethod · 0.80
RenderMethod · 0.80
TableSetupColumnMethod · 0.80
DebugLogVMethod · 0.80
TabItemExMethod · 0.80

Calls 2

ImMaxFunction · 0.85
reserveMethod · 0.80

Tested by

no test coverage detected