MCPcopy Create free account
hub / github.com/PCSX2/pcsx2 / append

Method append

3rdparty/imgui/src/imgui.cpp:3154–3170  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 15

WriteMethod · 0.45
LoadDataMethod · 0.45
SetProgressMessageFunction · 0.45
ArgvToCommandLineFunction · 0.45
TableSetupColumnMethod · 0.45
DebugLogVMethod · 0.45
DebugHookIdInfoMethod · 0.45
TabItemExMethod · 0.45
InitMethod · 0.45

Calls 4

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

Tested by 5

InitMethod · 0.36
CapturedStreamMethod · 0.36
UrlEncodeMethod · 0.36
GetDirFromEnvFunction · 0.36
RegisterTestsMethod · 0.36