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

#include <json_settings_internals.h>

Inheritance diagram for JSON_SETTINGS_INTERNALS:

Public Member Functions

 JSON_SETTINGS_INTERNALS ()
 
template<typename ValueType >
void SetFromString (const std::string &aPath, ValueType aVal)
 
template<typename ValueType >
ValueType Get (const std::string &aPath) const
 
nlohmann::json & At (const std::string &aPath)
 
nlohmann::json & operator[] (const nlohmann::json::json_pointer &aPointer)
 
nlohmann::json & operator[] (const std::string &aPath)
 
void CloneFrom (const JSON_SETTINGS_INTERNALS &aOther)
 

Static Public Member Functions

static nlohmann::json::json_pointer PointerFromString (std::string aPath)
 Builds a JSON pointer based on a given string.
 

Private Attributes

nlohmann::json m_original
 

Friends

class JSON_SETTINGS
 

Detailed Description

Definition at line 26 of file json_settings_internals.h.

Constructor & Destructor Documentation

◆ JSON_SETTINGS_INTERNALS()

JSON_SETTINGS_INTERNALS::JSON_SETTINGS_INTERNALS ( )
inline

Definition at line 31 of file json_settings_internals.h.

Member Function Documentation

◆ At()

nlohmann::json & JSON_SETTINGS_INTERNALS::At ( const std::string &  aPath)
inline

Definition at line 55 of file json_settings_internals.h.

◆ CloneFrom()

void JSON_SETTINGS_INTERNALS::CloneFrom ( const JSON_SETTINGS_INTERNALS aOther)
inline

Definition at line 70 of file json_settings_internals.h.

◆ Get()

template<typename ValueType >
ValueType JSON_SETTINGS_INTERNALS::Get ( const std::string &  aPath) const
inline

Definition at line 50 of file json_settings_internals.h.

◆ operator[]() [1/2]

nlohmann::json & JSON_SETTINGS_INTERNALS::operator[] ( const nlohmann::json::json_pointer &  aPointer)
inline

Definition at line 60 of file json_settings_internals.h.

◆ operator[]() [2/2]

nlohmann::json & JSON_SETTINGS_INTERNALS::operator[] ( const std::string &  aPath)
inline

Definition at line 65 of file json_settings_internals.h.

◆ PointerFromString()

nlohmann::json::json_pointer JSON_SETTINGS_INTERNALS::PointerFromString ( std::string  aPath)
static

Builds a JSON pointer based on a given string.

Parameters
aPathis the path in the form "key1.key2.key3"
Returns
a JSON pointer that can be used to index into a JSON object

Definition at line 47 of file json_settings.cpp.

Referenced by JSON_SETTINGS::Contains(), PCB_CALCULATOR_SETTINGS::MigrateFromLegacy(), JSON_SETTINGS::SaveToFile(), and JSON_SETTINGS::SetIfPresent().

◆ SetFromString()

template<typename ValueType >
void JSON_SETTINGS_INTERNALS::SetFromString ( const std::string &  aPath,
ValueType  aVal 
)
inline

Definition at line 43 of file json_settings_internals.h.

Friends And Related Function Documentation

◆ JSON_SETTINGS

friend class JSON_SETTINGS
friend

Definition at line 28 of file json_settings_internals.h.

Member Data Documentation

◆ m_original

nlohmann::json JSON_SETTINGS_INTERNALS::m_original
private

Definition at line 78 of file json_settings_internals.h.


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