29                                  const std::string& aPath, 
bool aLoadFromFile ) :
 
 
   40        m_parent->ReleaseNestedSettings( 
this );
 
 
   53        if( 
m_parent->m_internals->contains( ptr ) )
 
   65                wxLogTrace( 
traceSettings, wxT( 
"NESTED_SETTINGS %s: Could not load from " 
   82            wxLogTrace( 
traceSettings, wxT( 
"%s: nested settings version could not be read!" ),
 
   89            wxLogTrace( 
traceSettings, wxT( 
"%s: attempting migration from version %d to %d" ),
 
   92            bool migrated = 
false;
 
  112                        wxT( 
"%s: warning: nested settings version %d is newer than latest (%d)" ),
 
  115        else if( filever >= 0 )
 
  117            wxLogTrace( 
traceSettings, wxT( 
"%s: schema version %d is current" ),
 
 
  137        bool modified = 
Store();
 
  141        if( !jsonObjectInParent )
 
  143        else if( !nlohmann::json::diff( *
m_internals, jsonObjectInParent.value() ).empty() )
 
  146        if( modified || aForce )
 
  150            wxLogTrace( 
traceSettings, wxS( 
"Stored NESTED_SETTINGS %s with schema %d" ),
 
  159        wxLogTrace( 
traceSettings, wxS( 
"NESTED_SETTINGS %s: Could not store to %s at %s" ),
 
 
  175        m_parent->AddNestedSettings( 
this );
 
 
wxString m_filename
The filename (not including path) of this settings file (inicode)
 
virtual void Load()
Updates the parameters of this object based on the current JSON document contents.
 
wxString GetFullFilename() const
 
bool Migrate()
Migrates the schema of this settings from the version in the file to the latest version.
 
JSON_SETTINGS(const wxString &aFilename, SETTINGS_LOC aLocation, int aSchemaVersion)
 
std::unique_ptr< JSON_SETTINGS_INTERNALS > m_internals
 
friend class NESTED_SETTINGS
 
int m_schemaVersion
Version of this settings schema.
 
virtual bool Store()
Stores the current parameters into the JSON document represented by this object Note: this doesn't do...
 
wxString GetFilename() const
 
Instantiate the current locale within a scope in which you are expecting exceptions to be thrown.
 
void SetParent(JSON_SETTINGS *aParent, bool aLoadFromFile=true)
 
std::string m_path
The path (in pointer format) of where to store this document in the parent.
 
JSON_SETTINGS * m_parent
A pointer to the parent object to load and store from.
 
virtual ~NESTED_SETTINGS()
 
bool SaveToFile(const wxString &aDirectory="", bool aForce=false) override
Calls Store() and then saves the JSON document contents into the parent JSON_SETTINGS.
 
bool LoadFromFile(const wxString &aDirectory="") override
Loads the JSON document from the parent and then calls Load()
 
@ NESTED
Not stored in a file, but inside another JSON_SETTINGS.
 
std::vector< FAB_LAYER_COLOR > dummy