MCPcopy Create free account
hub / github.com/BlitterStudio/amiberry / append

Method append

external/imgui/imgui.cpp:3159–3175  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3157char ImGuiTextBuffer::EmptyString[1] = { 0 };
3158
3159void ImGuiTextBuffer::append(const char* str, const char* str_end)
3160{
3161 int len = str_end ? (int)(str_end - str) : (int)ImStrlen(str);
3162
3163 // Add zero-terminator the first time
3164 const int write_off = (Buf.Size != 0) ? Buf.Size : 1;
3165 const int needed_sz = write_off + len;
3166 if (write_off + len >= Buf.Capacity)
3167 {
3168 int new_capacity = Buf.Capacity * 2;
3169 Buf.reserve(needed_sz > new_capacity ? needed_sz : new_capacity);
3170 }
3171
3172 Buf.resize(needed_sz);
3173 memcpy(&Buf[write_off - 1], str, (size_t)len);
3174 Buf[write_off - 1 + len] = 0;
3175}
3176
3177void ImGuiTextBuffer::appendf(const char* fmt, ...)
3178{

Callers 11

requireFunction · 0.45
mainFunction · 0.45
requireFunction · 0.45
enumSerialPortsMethod · 0.45
TableSetupColumnMethod · 0.45
DebugLogVMethod · 0.45
DebugHookIdInfoMethod · 0.45
TabItemExMethod · 0.45

Calls 4

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

Tested by

no test coverage detected