KiCad PCB EDA Suite
|
#include <parameters.h>
Public Member Functions | |
PARAM_BASE (std::string aJsonPath, bool aReadOnly) | |
virtual | ~PARAM_BASE ()=default |
virtual void | Load (const JSON_SETTINGS &aSettings, bool aResetIfMissing=true) const =0 |
Loads the value of this parameter from JSON to the underlying storage. | |
virtual void | Store (JSON_SETTINGS *aSettings) const =0 |
Stores the value of this parameter to the given JSON_SETTINGS object. | |
virtual void | SetDefault ()=0 |
virtual bool | MatchesFile (const JSON_SETTINGS &aSettings) const =0 |
Checks whether the parameter in memory matches the one in a given JSON file. | |
const std::string & | GetJsonPath () const |
bool | ClearUnknownKeys () const |
Protected Attributes | |
std::string | m_path |
Address of the param in the json files. | |
bool | m_readOnly |
Indicates param pointer should never be overwritten. | |
bool | m_clearUnknownKeys |
Keys should be cleared from source rather than merged. | |
Definition at line 35 of file parameters.h.
|
inline |
Definition at line 38 of file parameters.h.
|
virtualdefault |
|
inline |
Definition at line 78 of file parameters.h.
|
inline |
Definition at line 72 of file parameters.h.
|
pure virtual |
Loads the value of this parameter from JSON to the underlying storage.
aSettings | is the JSON_SETTINGS object to load from. |
aResetIfMissing | if true will set the parameter to its default value if load fails |
Implemented in COLOR_MAP_PARAM, PARAM< ValueType >, PARAM< wxString >, PARAM_PATH, PARAM_ENUM< EnumType >, PARAM_LAMBDA< ValueType >, PARAM_LAMBDA< nlohmann::json >, PARAM_SCALED< ValueType >, PARAM_LIST< Type >, PARAM_LIST< wxString >, PARAM_SET< Type >, PARAM_PATH_LIST, PARAM_MAP< Value >, and PARAM_WXSTRING_MAP.
|
pure virtual |
Checks whether the parameter in memory matches the one in a given JSON file.
aSettings | is a JSON_SETTINGS to check the JSON file contents of |
Implemented in COLOR_MAP_PARAM, PARAM< ValueType >, PARAM< wxString >, PARAM_PATH, PARAM_ENUM< EnumType >, PARAM_LAMBDA< ValueType >, PARAM_LAMBDA< nlohmann::json >, PARAM_SCALED< ValueType >, PARAM_LIST< Type >, PARAM_LIST< wxString >, PARAM_SET< Type >, PARAM_PATH_LIST, PARAM_MAP< Value >, and PARAM_WXSTRING_MAP.
|
pure virtual |
|
pure virtual |
Stores the value of this parameter to the given JSON_SETTINGS object.
aSettings | is the JSON_SETTINGS object to store into. |
Implemented in COLOR_MAP_PARAM, PARAM< ValueType >, PARAM< wxString >, PARAM_PATH, PARAM_ENUM< EnumType >, PARAM_LAMBDA< ValueType >, PARAM_LAMBDA< nlohmann::json >, PARAM_SCALED< ValueType >, PARAM_LIST< Type >, PARAM_LIST< wxString >, PARAM_SET< Type >, PARAM_PATH_LIST, PARAM_MAP< Value >, and PARAM_WXSTRING_MAP.
|
protected |
Keys should be cleared from source rather than merged.
This is useful for things that are semantically an array but stored as a map, such as textVars.
Definition at line 83 of file parameters.h.
|
protected |
Address of the param in the json files.
Definition at line 81 of file parameters.h.
Referenced by COLOR_MAP_PARAM::Load(), PARAM< ValueType >::Load(), PARAM_ENUM< EnumType >::Load(), PARAM_LAMBDA< ValueType >::Load(), PARAM_LIST< Type >::Load(), PARAM_WXSTRING_MAP::Load(), COLOR_MAP_PARAM::MatchesFile(), PARAM< ValueType >::MatchesFile(), PARAM_ENUM< EnumType >::MatchesFile(), PARAM_LAMBDA< ValueType >::MatchesFile(), PARAM_LIST< Type >::MatchesFile(), PARAM_PATH_LIST::MatchesFile(), PARAM_WXSTRING_MAP::MatchesFile(), COLOR_MAP_PARAM::Store(), PARAM< ValueType >::Store(), PARAM_ENUM< EnumType >::Store(), PARAM_LAMBDA< ValueType >::Store(), PARAM_LIST< Type >::Store(), PARAM_PATH_LIST::Store(), and PARAM_WXSTRING_MAP::Store().
|
protected |
Indicates param pointer should never be overwritten.
Definition at line 82 of file parameters.h.
Referenced by COLOR_MAP_PARAM::Load(), PARAM< ValueType >::Load(), PARAM_ENUM< EnumType >::Load(), PARAM_LAMBDA< ValueType >::Load(), PARAM_LIST< Type >::Load(), and PARAM_WXSTRING_MAP::Load().