Correlation 4.10.0
An Analysis Tool for Liquids and for Amorphous Solids
Loading...
Searching...
No Matches
PresetManager.hpp
Go to the documentation of this file.
1
8
9#pragma once
10
12
13#include <filesystem>
14#include <string>
15#include <vector>
16
17namespace correlation::app {
18
23struct Preset {
24 std::string name;
25 std::string description;
27};
28
34public:
35 PresetManager() = delete;
36
40 [[nodiscard]] static std::filesystem::path presetsDirectory();
41
45 [[nodiscard]] static std::vector<Preset> loadAll();
46
50 static void save(const Preset &preset);
51
55 static void remove(const std::string &name);
56
60 [[nodiscard]] static std::string toJson(const Preset &preset);
61
65 [[nodiscard]] static Preset fromJson(const std::string &json);
66};
67
68} // namespace correlation::app
Configuration structures and defaults for application analysis.
static Preset fromJson(const std::string &json)
Deserializes a Preset object from a JSON string.
Definition PresetManager.cpp:413
static void save(const Preset &preset)
Saves a preset to a JSON file in the presets directory.
Definition PresetManager.cpp:332
static std::vector< Preset > loadAll()
Loads all saved presets from the presets directory.
Definition PresetManager.cpp:301
static void remove(const std::string &name)
Deletes a saved preset by name.
Definition PresetManager.cpp:348
static std::filesystem::path presetsDirectory()
Gets the folder path where user presets are saved (~/.correlation/presets/).
Definition PresetManager.cpp:283
static std::string toJson(const Preset &preset)
Serializes a Preset object to a JSON string.
Definition PresetManager.cpp:364
Definition AppController.hpp:27
Represents a named set of user options for materials simulation analysis.
Definition PresetManager.hpp:23
std::string name
Definition PresetManager.hpp:24
std::string description
Definition PresetManager.hpp:25
ProgramOptions options
Definition PresetManager.hpp:26
Encapsulates all configurable options for the application.
Definition AppOptions.hpp:122