MCPcopy Create free account
hub / github.com/Palm1r/QodeAssist / sanitizeOutput

Method sanitizeOutput

tools/ExecuteTerminalCommandTool.cpp:431–443  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

429}
430
431QString ExecuteTerminalCommandTool::sanitizeOutput(const QString &output, qint64 totalSize) const
432{
433 if (totalSize > MAX_OUTPUT_SIZE) {
434 const QString truncated = output.left(MAX_OUTPUT_SIZE / 2);
435 return QString("%1\n\n... [Output truncated: exceeded maximum size of %2 MB. "
436 "Total output size was %3 bytes] ...")
437 .arg(truncated)
438 .arg(MAX_OUTPUT_SIZE / (1024 * 1024))
439 .arg(totalSize);
440 }
441
442 return output;
443}
444
445QStringList ExecuteTerminalCommandTool::getAllowedCommands() const
446{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected