Sonde
v1.1.0
Embeddable Model Context Protocol server for Qt applications
Toggle main menu visibility
Loading...
Searching...
No Matches
project.h
Go to the documentation of this file.
1
#pragma once
2
5
6
#include <QtCore/QJsonObject>
7
#include <QtCore/QString>
8
9
namespace
Sonde::Cli {
10
12
inline
constexpr
QLatin1StringView
kProjectDir
{
".sonde"
};
13
15
struct
Project
16
{
17
QString
root
;
18
20
QString
config
()
const
{
return
root
+ QStringLiteral(
"/.sonde/config.json"
); }
22
QString
local
()
const
{
return
root
+ QStringLiteral(
"/.sonde/local.json"
); }
24
QString
state
()
const
{
return
root
+ QStringLiteral(
"/.sonde/state"
); }
26
QString
endpointFile
()
const
{
return
state
() + QStringLiteral(
"/endpoint.json"
); }
27
29
void
makeState
()
const
;
30
};
31
34
Project findProject(
const
QString &explicitConfig);
35
37
QJsonObject readJsonObject(
const
QString &path);
38
41
QJsonObject mergeConfig(QJsonObject config,
const
QJsonObject &local);
42
44
QString configError(
const
QJsonObject &config,
const
QString &path);
45
48
QJsonObject loadConfig(
const
Project &project);
49
50
}
// namespace Sonde::Cli
Sonde::Cli::kProjectDir
constexpr QLatin1StringView kProjectDir
The directory a project keeps its files in, at its root.
Definition
project.h:12
Sonde::Cli::Project
Where a project keeps its files: .sonde/ at its root.
Definition
project.h:16
Sonde::Cli::Project::makeState
void makeState() const
Creates the state directory, and .sonde/.gitignore beside it.
Definition
project.cpp:40
Sonde::Cli::Project::config
QString config() const
.sonde/config.json.
Definition
project.h:20
Sonde::Cli::Project::root
QString root
The project's root directory, absolute, with '/' separators.
Definition
project.h:17
Sonde::Cli::Project::local
QString local() const
.sonde/local.json.
Definition
project.h:22
Sonde::Cli::Project::endpointFile
QString endpointFile() const
.sonde/state/endpoint.json.
Definition
project.h:26
Sonde::Cli::Project::state
QString state() const
.sonde/state.
Definition
project.h:24
tools
cli
project.h
Generated by
1.18.0