ProjectFile struct

A project, as its .tnxproject file describes it.

The file is small JSON at the top of the project's folder, and holds only what can't be found by looking in that folder. Settings stay in the project's .ini files.

{ "project": "MyGame", "version": 1, "module": "MyGame", "engine": { "version": "0.1", "path": "" } }

Public static variables

static int Version constexpr
the file format this engine writes

Public static functions

static auto FindIn(const std::filesystem::path& folder, std::string& why) -> std::filesystem::path
The one .tnxproject file in folder. Empty when there is none; when there are several, why says which, and the result is empty.
static auto Load(const std::filesystem::path& fileOrFolder, ProjectFile& out, std::string& why) -> bool
Read fileOrFolder: a .tnxproject file, or a folder with one in it. On failure why says what to change and out is left as it was.

Public functions

auto Folder() const -> std::filesystem::path
The folder the project is in: the file's.
auto ModuleName() const -> const std::string&
The module's name: Module, or Name when that is empty.
auto Save(std::string& why) const -> bool
Write it to File. On failure why says why.

Public variables

std::string Name
the project's name: its <Name>Defaults.ini, its module and executable unless set
std::string Module
the project's code module; empty: the same as Name
std::string EngineVersion
the engine version the project was made with
std::string EnginePath
the engine's source folder, as written (relative to the project, or absolute); empty: the installed engine
std::filesystem::path File
where it was read from or will be written