MCPcopy Create free account
hub / github.com/ZDoom/Raze / AddString

Method AddString

source/common/console/c_commandbuffer.cpp:289–314  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

287}
288
289void FCommandBuffer::AddString(FString clip)
290{
291 if (clip.IsNotEmpty())
292 {
293 // Only paste the first line.
294 auto brk = clip.IndexOfAny("\r\n\b");
295 std::u32string build;
296 if (brk >= 0)
297 {
298 clip.Truncate(brk);
299 }
300 auto strp = (const uint8_t*)clip.GetChars();
301 while (auto chr = GetCharFromString(strp)) build += chr;
302
303 if (Text.length() == 0)
304 {
305 Text = build;
306 }
307 else
308 {
309 Text.insert(CursorPos, build);
310 }
311 CursorPos += (unsigned)build.length();
312 MakeStartPosGood();
313 }
314}
315
316void FCommandBuffer::SetString(const FString &str)
317{

Callers 2

PrintStringFunction · 0.45
C_HandleKeyFunction · 0.45

Calls 7

IsNotEmptyMethod · 0.80
IndexOfAnyMethod · 0.80
TruncateMethod · 0.80
lengthMethod · 0.80
GetCharFromStringFunction · 0.50
GetCharsMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected