KiCad PCB EDA Suite
Loading...
Searching...
No Matches
PARAM_LAYER_PAIRS Class Reference

#include <board_project_settings.h>

Inheritance diagram for PARAM_LAYER_PAIRS:
PARAM_LAMBDA< nlohmann::json > PARAM_BASE

Public Member Functions

 PARAM_LAYER_PAIRS (const std::string &aPath, std::vector< LAYER_PAIR_INFO > &m_layerPairInfos)
 
void Load (JSON_SETTINGS *aSettings, bool aResetIfMissing=true) const override
 Loads the value of this parameter from JSON to the underlying storage.
 
void Store (JSON_SETTINGS *aSettings) const override
 Stores the value of this parameter to the given JSON_SETTINGS object.
 
nlohmann::json GetDefault () const
 
void SetDefault () override
 
bool MatchesFile (JSON_SETTINGS *aSettings) const override
 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.
 

Private Member Functions

nlohmann::json layerPairsToJson ()
 
void jsonToLayerPairs (const nlohmann::json &aJson)
 

Private Attributes

std::vector< LAYER_PAIR_INFO > & m_layerPairInfos
 
nlohmann::json m_default
 
std::function< nlohmann::json()> m_getter
 
std::function< void(nlohmann::json)> m_setter
 

Detailed Description

Definition at line 324 of file board_project_settings.h.

Constructor & Destructor Documentation

◆ PARAM_LAYER_PAIRS()

PARAM_LAYER_PAIRS::PARAM_LAYER_PAIRS ( const std::string &  aPath,
std::vector< LAYER_PAIR_INFO > &  m_layerPairInfos 
)

Definition at line 310 of file board_project_settings.cpp.

Member Function Documentation

◆ ClearUnknownKeys()

bool PARAM_BASE::ClearUnknownKeys ( ) const
inlineinherited
Returns
true if keys should be cleared from source file rather than merged. Useful for things such as text variables that are semantically an array but stored as a map.

Definition at line 78 of file parameters.h.

◆ GetDefault()

nlohmann::json PARAM_LAMBDA< nlohmann::json >::GetDefault ( ) const
inlineinherited

Definition at line 337 of file parameters.h.

◆ GetJsonPath()

const std::string & PARAM_BASE::GetJsonPath ( ) const
inlineinherited
Returns
the path name of the parameter used to store it in the json file mainly useful in error messages

Definition at line 72 of file parameters.h.

◆ jsonToLayerPairs()

void PARAM_LAYER_PAIRS::jsonToLayerPairs ( const nlohmann::json &  aJson)
private

Definition at line 346 of file board_project_settings.cpp.

References m_layerPairInfos, and name.

◆ layerPairsToJson()

nlohmann::json PARAM_LAYER_PAIRS::layerPairsToJson ( )
private

◆ Load()

void PARAM_LAMBDA< nlohmann::json >::Load ( JSON_SETTINGS aSettings,
bool  aResetIfMissing = true 
) const
inlineoverridevirtualinherited

Loads the value of this parameter from JSON to the underlying storage.

Parameters
aSettingsis the JSON_SETTINGS object to load from.
aResetIfMissingif true will set the parameter to its default value if load fails

Implements PARAM_BASE.

Definition at line 305 of file parameters.h.

◆ MatchesFile()

bool PARAM_LAMBDA< nlohmann::json >::MatchesFile ( JSON_SETTINGS aSettings) const
inlineoverridevirtualinherited

Checks whether the parameter in memory matches the one in a given JSON file.

Parameters
aSettingsis a JSON_SETTINGS to check the JSON file contents of
Returns
true if the parameter in memory matches its value in the file

Implements PARAM_BASE.

Definition at line 347 of file parameters.h.

◆ SetDefault()

void PARAM_LAMBDA< nlohmann::json >::SetDefault ( )
inlineoverridevirtualinherited

Implements PARAM_BASE.

Definition at line 342 of file parameters.h.

◆ Store()

void PARAM_LAMBDA< nlohmann::json >::Store ( JSON_SETTINGS aSettings) const
inlineoverridevirtualinherited

Stores the value of this parameter to the given JSON_SETTINGS object.

Parameters
aSettingsis the JSON_SETTINGS object to store into.

Implements PARAM_BASE.

Definition at line 326 of file parameters.h.

Member Data Documentation

◆ m_clearUnknownKeys

bool PARAM_BASE::m_clearUnknownKeys
protectedinherited

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.

◆ m_default

nlohmann::json PARAM_LAMBDA< nlohmann::json >::m_default
privateinherited

Definition at line 365 of file parameters.h.

◆ m_getter

std::function<nlohmann::json ()> PARAM_LAMBDA< nlohmann::json >::m_getter
privateinherited

Definition at line 366 of file parameters.h.

◆ m_layerPairInfos

std::vector<LAYER_PAIR_INFO>& PARAM_LAYER_PAIRS::m_layerPairInfos
private

Definition at line 334 of file board_project_settings.h.

Referenced by jsonToLayerPairs(), and layerPairsToJson().

◆ m_path

◆ m_readOnly

bool PARAM_BASE::m_readOnly
protectedinherited

◆ m_setter

std::function<void( nlohmann::json )> PARAM_LAMBDA< nlohmann::json >::m_setter
privateinherited

Definition at line 367 of file parameters.h.


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