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

Method tableAdd

app/src/API/Handlers/DataTablesHandler.cpp:393–405  ·  view source on GitHub ↗

* @brief Creates a new table with the given (optional) name. */

Source from the content-addressed store, hash-verified

391 * @brief Creates a new table with the given (optional) name.
392 */
393API::CommandResponse API::Handlers::DataTablesHandler::tableAdd(const QString& id,
394 const QJsonObject& params)
395{
396 const QString desired =
397 params.value(QStringLiteral("name")).toString(QStringLiteral("Shared Table"));
398
399 const QString actual = DataModel::ProjectModel::instance().addTable(desired);
400
401 QJsonObject result;
402 result[QStringLiteral("name")] = actual;
403 result[QStringLiteral("added")] = true;
404 return CommandResponse::makeSuccess(id, result);
405}
406
407/**
408 * @brief Deletes a table by name. With dryRun:true, reports what would be deleted without

Callers

nothing calls this directly

Calls 2

addTableMethod · 0.80
valueMethod · 0.45

Tested by

no test coverage detected