46 void ApplicationProperties::openFiles()
55 if (userProps ==
nullptr)
61 if (commonProps ==
nullptr)
67 userProps->setFallbackPropertySet (commonProps.get());
73 if (userProps ==
nullptr)
76 return userProps.get();
81 if (commonProps ==
nullptr)
84 if (returnUserPropsIfReadOnly)
86 if (commonSettingsAreReadOnly == 0)
87 commonSettingsAreReadOnly = commonProps->save() ? -1 : 1;
89 if (commonSettingsAreReadOnly > 0)
90 return userProps.get();
93 return commonProps.get();
98 return (userProps ==
nullptr || userProps->saveIfNeeded())
99 && (commonProps ==
nullptr || commonProps->saveIfNeeded());
String applicationName
The name of your application - this is used to help generate the path and filename at which the prope...
Structure describing properties file options.
void setStorageParameters(const PropertiesFile::Options &options)
Gives the object the information it needs to create the appropriate properties files.
bool isNotEmpty() const noexcept
Returns true if the string contains at least one character.
PropertiesFile * getUserSettings()
Returns the user settings file.
Wrapper on a file that stores a list of key/value data pairs.
PropertiesFile * getCommonSettings(bool returnUserPropsIfReadOnly)
Returns the common settings file.
bool saveIfNeeded()
Saves both files if they need to be saved.
bool commonToAllUsers
If true, the file will be created in a location that's shared between users.
void closeFiles()
Flushes and closes both files if they are open.
~ApplicationProperties()
Destructor.
ApplicationProperties()
Creates an ApplicationProperties object.