Correlation 4.10.0
An Analysis Tool for Liquids and for Amorphous Solids
Loading...
Searching...
No Matches
correlation::app::PresetManager Class Reference

Manages saving and loading analysis parameter presets to/from JSON files. More...

#include <PresetManager.hpp>

Public Member Functions

 PresetManager ()=delete

Static Public Member Functions

static std::filesystem::path presetsDirectory ()
 Gets the folder path where user presets are saved (~/.correlation/presets/).
static std::vector< Preset > loadAll ()
 Loads all saved presets from the presets directory.
static void save (const Preset &preset)
 Saves a preset to a JSON file in the presets directory.
static void remove (const std::string &name)
 Deletes a saved preset by name.
static std::string toJson (const Preset &preset)
 Serializes a Preset object to a JSON string.
static Preset fromJson (const std::string &json)
 Deserializes a Preset object from a JSON string.

Detailed Description

Manages saving and loading analysis parameter presets to/from JSON files.

Constructor & Destructor Documentation

◆ PresetManager()

correlation::app::PresetManager::PresetManager ( )
delete

Member Function Documentation

◆ fromJson()

Preset correlation::app::PresetManager::fromJson ( const std::string & json)
staticnodiscard

Deserializes a Preset object from a JSON string.

Here is the caller graph for this function:

◆ loadAll()

std::vector< Preset > correlation::app::PresetManager::loadAll ( )
staticnodiscard

Loads all saved presets from the presets directory.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ presetsDirectory()

std::filesystem::path correlation::app::PresetManager::presetsDirectory ( )
staticnodiscard

Gets the folder path where user presets are saved (~/.correlation/presets/).

Here is the caller graph for this function:

◆ remove()

void correlation::app::PresetManager::remove ( const std::string & name)
static

Deletes a saved preset by name.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ save()

void correlation::app::PresetManager::save ( const Preset & preset)
static

Saves a preset to a JSON file in the presets directory.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ toJson()

std::string correlation::app::PresetManager::toJson ( const Preset & preset)
staticnodiscard

Serializes a Preset object to a JSON string.

Here is the caller graph for this function:

The documentation for this class was generated from the following files: