MCPcopy Create free account
hub / github.com/beefytech/Beef / Insert

Method Insert

BeefySysLib/util/String.cpp:570–588  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

568}
569
570void StringImpl::Insert(intptr idx, const char* str, intptr length)
571{
572 BF_ASSERT(idx >= 0);
573
574 int_strsize newLength = mLength + (int_strsize)length;
575 if (newLength >= GetAllocSize())
576 {
577 intptr newSize = max((int_strsize)GetAllocSize() * 2, newLength + 1);
578 Realloc(newSize);
579 }
580
581 auto moveChars = mLength - idx;
582 auto ptr = GetMutablePtr();
583 if (moveChars > 0)
584 memmove(ptr + idx + length, ptr + idx, moveChars);
585 memcpy(ptr + idx, str, length);
586 mLength = newLength;
587 ptr[mLength] = 0;
588}
589
590void StringImpl::Insert(intptr idx, const StringImpl& addString)
591{

Callers 15

GetRelativePathMethod · 0.45
Res_JPEGCompressFunction · 0.45
Res_WritePNGFunction · 0.45
WriteMethod · 0.45
CompactMethod · 0.45
GenerateCollisionDataMethod · 0.45
ReadFileMethod · 0.45
ModelInstanceMethod · 0.45
GetClipboardDataMethod · 0.45
DoHandleDebugEventFunction · 0.45

Calls 1

GetPtrMethod · 0.45

Tested by

no test coverage detected