21#ifndef KICAD_JSON_SETTINGS_INTERNALS_H
22#define KICAD_JSON_SETTINGS_INTERNALS_H
40 static nlohmann::json::json_pointer PointerFromString( std::string aPath );
42 template<
typename ValueType>
46 ( *this )[aPath] = std::move( aVal );
49 template<
typename ValueType>
50 ValueType
Get(
const std::string& aPath )
const
52 return at( PointerFromString( aPath ) ).get<ValueType>();
55 nlohmann::json&
At(
const std::string& aPath )
57 return at( PointerFromString( aPath ) );
60 nlohmann::json&
operator[](
const nlohmann::json::json_pointer& aPointer )
62 return nlohmann::json::operator[]( aPointer );
67 return nlohmann::json::operator[]( PointerFromString( aPath ) );
72 nlohmann::json::json_pointer root(
"" );
73 this->nlohmann::json::operator[]( root ) = aOther.nlohmann::json::operator[]( root );
nlohmann::json & At(const std::string &aPath)
nlohmann::json & operator[](const std::string &aPath)
JSON_SETTINGS_INTERNALS()
nlohmann::json & operator[](const nlohmann::json::json_pointer &aPointer)
nlohmann::json m_original
void SetFromString(const std::string &aPath, ValueType aVal)
void CloneFrom(const JSON_SETTINGS_INTERNALS &aOther)
ValueType Get(const std::string &aPath) const