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

A project's files under .sonde/, and its configuration (design 0028). More...

#include "project.h"
#include "common.h"
#include <QtCore/QDir>
#include <QtCore/QFile>
#include <QtCore/QFileInfo>
#include <QtCore/QJsonArray>
#include <QtCore/QJsonDocument>
#include <algorithm>

Namespaces

namespace  Sonde
 Embeddable Model Context Protocol server for Qt applications.

Functions

bool Sonde::Cli::anonymous_namespace{project.cpp}::isStringList (const QJsonValue &value)
 Whether value is a list of strings.
Project Sonde::Cli::findProject (const QString &explicitConfig)
 The project of the configuration file explicitConfig (--config), or else the first one here or above.
QJsonObject Sonde::Cli::readJsonObject (const QString &path)
 The JSON object in the file path; fails if it can't be read or isn't one.
QJsonObject Sonde::Cli::mergeConfig (QJsonObject config, const QJsonObject &local)
 config with local over it: the local keys replace the shared ones, except "env", whose variables are added to the shared ones.
QString Sonde::Cli::configError (const QJsonObject &config, const QString &path)
 What is wrong with config, read from path, or an empty string.
QJsonObject Sonde::Cli::loadConfig (const Project &project)
 The project's configuration: config.json with local.json over it.

Variables

constexpr QLatin1StringView Sonde::Cli::anonymous_namespace{project.cpp}::kOldConfigName { ".qtmcp-run.json" }
 The configuration file of a project set up before Sonde 0.5.
constexpr QLatin1StringView Sonde::Cli::anonymous_namespace{project.cpp}::kGitignore
 What .sonde/.gitignore holds.

Detailed Description

A project's files under .sonde/, and its configuration (design 0028).

Function Documentation

◆ findProject()

Project Sonde::Cli::findProject ( const QString & explicitConfig)

The project of the configuration file explicitConfig (--config), or else the first one here or above.

Fails if there is none.

◆ loadConfig()

QJsonObject Sonde::Cli::loadConfig ( const Project & project)

The project's configuration: config.json with local.json over it.

Fails if either can't be read, or the result isn't a valid configuration.