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

Method exportToCsv

app/src/API/Handlers/SessionsHandler.cpp:505–519  ·  view source on GitHub ↗

* @brief Export a session to CSV (async; check sessions.getStatus / busy). */

Source from the content-addressed store, hash-verified

503 * @brief Export a session to CSV (async; check sessions.getStatus / busy).
504 */
505API::CommandResponse API::Handlers::SessionsHandler::exportToCsv(const QString& id,
506 const QJsonObject& params)
507{
508 if (!params.contains(QStringLiteral("sessionId")))
509 return CommandResponse::makeError(
510 id, ErrorCode::MissingParam, QStringLiteral("Missing required parameter: sessionId"));
511
512 const int sessionId = params.value(QStringLiteral("sessionId")).toInt();
513 Sessions::DatabaseManager::instance().exportSessionToCsv(sessionId);
514
515 QJsonObject result;
516 result[QStringLiteral("sessionId")] = sessionId;
517 result[QStringLiteral("exporting")] = true;
518 return CommandResponse::makeSuccess(id, result);
519}
520
521//--------------------------------------------------------------------------------------------------
522// Tags

Callers

nothing calls this directly

Calls 3

exportSessionToCsvMethod · 0.80
containsMethod · 0.45
valueMethod · 0.45

Tested by

no test coverage detected