MCPcopy Create free account
hub / github.com/baldurk/renderdoc / ProcessReadBuffer

Method ProcessReadBuffer

qrenderdoc/Code/RGPInterop.cpp:436–464  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

434}
435
436void RGPInterop::ProcessReadBuffer()
437{
438 // we might have partial data, so wait until we have a full command
439 do
440 {
441 int idx = m_ReadBuffer.indexOf("endcommand=");
442
443 // if we don't have endcommand= yet, we don't have a full command
444 if(idx < 0)
445 return;
446
447 idx = m_ReadBuffer.indexOf('\n', idx);
448
449 // also break if we don't have the full line yet including newline.
450 if(idx < 0)
451 return;
452
453 // extract the command and decode as UTF-8
454 QString command = QString::fromUtf8(m_ReadBuffer.data(), idx + 1);
455
456 // remove the command from our buffer, to retain any partial subsequent command we might have
457 m_ReadBuffer.remove(0, idx + 1);
458
459 // process this command
460 DecodeCommand(command);
461
462 // loop again - we might have read multiple commands
463 } while(true);
464}

Callers

nothing calls this directly

Calls 4

fromUtf8Function · 0.50
indexOfMethod · 0.45
dataMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected