MCPcopy Create free account
hub / github.com/AlexandreRouma/SDRPlusPlus / append

Method append

core/src/imgui/imgui.cpp:2137–2153  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2135char ImGuiTextBuffer::EmptyString[1] = { 0 };
2136
2137void ImGuiTextBuffer::append(const char* str, const char* str_end)
2138{
2139 int len = str_end ? (int)(str_end - str) : (int)strlen(str);
2140
2141 // Add zero-terminator the first time
2142 const int write_off = (Buf.Size != 0) ? Buf.Size : 1;
2143 const int needed_sz = write_off + len;
2144 if (write_off + len >= Buf.Capacity)
2145 {
2146 int new_capacity = Buf.Capacity * 2;
2147 Buf.reserve(needed_sz > new_capacity ? needed_sz : new_capacity);
2148 }
2149
2150 Buf.resize(needed_sz);
2151 memcpy(&Buf[write_off - 1], str, (size_t)len);
2152 Buf[write_off - 1 + len] = 0;
2153}
2154
2155void ImGuiTextBuffer::appendf(const char* fmt, ...)
2156{

Callers 6

get_cbor_stringMethod · 0.45
TableSetupColumnMethod · 0.45
TabItemExMethod · 0.45

Calls 2

resizeMethod · 0.80
reserveMethod · 0.45

Tested by

no test coverage detected