Sonde v1.1.0
Embeddable Model Context Protocol server for Qt applications
Loading...
Searching...
No Matches
run.h File Reference

Running the application: sonde start (and restart), stop, status and log (design 0028). More...

#include "project.h"
#include <QtCore/QJsonObject>
#include <QtCore/QString>
#include <QtCore/QStringList>

Go to the source code of this file.

Namespaces

namespace  Sonde
 Embeddable Model Context Protocol server for Qt applications.

Functions

QString Sonde::Cli::tail (const QString &path, int lines)
 The last lines lines of the file at path, as the Python sonde's tail() gave them: Python's readlines()[-lines:], so 0 gives every line.
QStringList Sonde::Cli::runCommand (const QJsonObject &config, const QString &root)
 The command that starts the application: "run", with a bundle replaced by its binary and, on Windows, .exe added where "run" leaves it out.
void Sonde::Cli::start (const QJsonObject &config, const Project &project, bool build)
 sonde start: builds (if build), stops any copy started earlier, starts the application and waits until Sonde listens.
void Sonde::Cli::stop (const Project &project, bool quiet=false)
 sonde stop: stops the copy sonde started, saying so unless quiet.
void Sonde::Cli::status (const QJsonObject &config, const Project &project)
 sonde status: whether the copy sonde started is running, its pid and endpoints.
void Sonde::Cli::showLog (const Project &project, int lines)
 sonde log: the last lines lines of the application's output.

Detailed Description

Running the application: sonde start (and restart), stop, status and log (design 0028).

Function Documentation

◆ start()

void Sonde::Cli::start ( const QJsonObject & config,
const Project & project,
bool build )

sonde start: builds (if build), stops any copy started earlier, starts the application and waits until Sonde listens.

Exits with 1 if it doesn't, 2 if the build fails.

◆ tail()

QString Sonde::Cli::tail ( const QString & path,
int lines )

The last lines lines of the file at path, as the Python sonde's tail() gave them: Python's readlines()[-lines:], so 0 gives every line.

Empty if the file can't be read.