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

Method append

tutorials/common/imgui/imgui.cpp:2485–2501  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2483char ImGuiTextBuffer::EmptyString[1] = { 0 };
2484
2485void ImGuiTextBuffer::append(const char* str, const char* str_end)
2486{
2487 int len = str_end ? (int)(str_end - str) : (int)strlen(str);
2488
2489 // Add zero-terminator the first time
2490 const int write_off = (Buf.Size != 0) ? Buf.Size : 1;
2491 const int needed_sz = write_off + len;
2492 if (write_off + len >= Buf.Capacity)
2493 {
2494 int new_capacity = Buf.Capacity * 2;
2495 Buf.reserve(needed_sz > new_capacity ? needed_sz : new_capacity);
2496 }
2497
2498 Buf.resize(needed_sz);
2499 memcpy(&Buf[write_off - 1], str, (size_t)len);
2500 Buf[write_off - 1 + len] = 0;
2501}
2502
2503void ImGuiTextBuffer::appendf(const char* fmt, ...)
2504{

Callers 12

runConfigFunction · 0.80
renderFunction · 0.80
recurseFunction · 0.80
TableSetupColumnMethod · 0.80
DebugLogVMethod · 0.80
TabItemExMethod · 0.80
operator+=Function · 0.80
tagsAsStringMethod · 0.80
convertMethod · 0.80

Calls 4

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

Tested by 1

runConfigFunction · 0.64