MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / write

Method write

app/src/AI/FileSandbox.cpp:609–621  ·  view source on GitHub ↗

* @brief Writes content to an 'AI/' file, replacing it atomically. */

Source from the content-addressed store, hash-verified

607 * @brief Writes content to an 'AI/' file, replacing it atomically.
608 */
609QJsonObject AI::FileSandbox::write(const QJsonObject& args) const
610{
611 const auto resolved = resolveWrite(args.value(QStringLiteral("path")).toString());
612 if (!resolved.ok)
613 return failure(resolved.error, resolved.hint);
614
615 const auto payload = args.value(QStringLiteral("content")).toString().toUtf8();
616 if (payload.size() > kMaxWriteBytes)
617 return failure(QStringLiteral("too_large"),
618 QStringLiteral("Content exceeds the 4 MB write cap; split it into parts."));
619
620 return writeBytes(resolved.path, payload, false, workspaceRoot());
621}
622
623/**
624 * @brief Appends content to an 'AI/' file, creating it if needed.

Callers 8

writeRawDataMethod · 0.45
broadcastEventMethod · 0.45
writeToSocketMethod · 0.45
processItemsMethod · 0.45
writeBytesFunction · 0.45
executeFsToolFunction · 0.45
saveChatMethod · 0.45
writeIndexMethod · 0.45

Calls 4

failureFunction · 0.85
writeBytesFunction · 0.85
valueMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected