Provides cross-platform support for persistent application settings.
Inherits :
DAZ Script |
---|
DzAppSettings () |
DzAppSettings ( String startPath ) |
DAZ Script | |
---|---|
Boolean | containsValue ( String key ) |
Boolean | getBoolValue ( String key, Boolean def=false ) |
Color | getColorValue ( String key, Color def=Color ) |
DzFloatColor | getFloatColorValue ( String key, DzFloatColor def=DzFloatColor ) |
Number | getFloatValue ( String key, Number def=0.0 ) |
Number | getIntValue ( String key, Number def=0 ) |
String | getStringValue ( String key, String def=“” ) |
void | popPath () |
void | pushPath ( String path ) |
Boolean | removeKey ( String key ) |
Boolean | removeValue ( String key ) |
Boolean | setBoolValue ( String key, Boolean setting ) |
Boolean | setColorValue ( String key, Color setting ) |
Boolean | setFloatColorValue ( String key, DzFloatColor setting ) |
Boolean | setFloatValue ( String key, Number setting ) |
Boolean | setIntValue ( String key, Number setting ) |
Boolean | setStringValue ( String key, String setting ) |
Application Settings are used to store and retrieve settings that persist from one execution of the application to the next. On Windows, the settings are saved in the registry. On Mac, these settings are saved via Mac preference plist files.
You can create an instance of this class any time you need to read or write persistent settings. This class is a replacement for DzAppSettingsMgr as it is easier and safer to use. Since each instance is separate, the current path of one instance will not affect the rest of the application. It is also not necessary to call popPath() to put this class back into its previous state.
Default Constructor - creates a new settings object that starts out at the default application path.
DzAppSettings( String startPath )
Constructor - creates a new settings object that pushes the given path onto the default application path. This is the same as using the default constructor and then calling pushPath() with the given path.
Boolean : containsValue( String key )
Parameter(s):
Return Value:
true
if this settings contains the named value, otherwise false
.Boolean : getBoolValue( String key, Boolean def=false )
Read a boolean value from the given key.
Parameter(s):
Return Value:
See Also:
Color : getColorValue( String key, Color def=Color )
Read a color value from the given key.
Parameter(s):
Return Value:
See Also:
DzFloatColor : getFloatColorValue( String key, DzFloatColor def=DzFloatColor )
Read a float color value from the given key.
Parameter(s):
Return Value:
See Also:
Number : getFloatValue( String key, Number def=0.0 )
Read a floating point value from the given key.
Parameter(s):
Return Value:
See Also:
Number : getIntValue( String key, Number def=0 )
Read a integer value from the given key.
Parameter(s):
Return Value:
See Also:
String : getStringValue( String key, String def=“” )
Read a string value from the given key.
Parameter(s):
Return Value:
See Also:
void : popPath()
Pops a temporary key path off the top of the stack.
void : pushPath( String path )
Sets the current key path temporarily to the given path; popPath() can be called to remove this path.
Parameter(s):
Boolean : removeKey( String key )
Removes a key (and all values, sub-keys/ by name.
Parameter(s):
Since:
Boolean : removeValue( String key )
Removes a setting by name.
Parameter(s):
Return Value:
true
if the key/value existed and was successfully removed, otherwise false
.Boolean : setBoolValue( String key, Boolean setting )
Sets a key with a boolean value.
Parameter(s):
Return Value:
true
if the key/value was successfully set, otherwise false
.See Also:
Boolean : setColorValue( String key, Color setting )
Sets a key with a color value.
Parameter(s):
Return Value:
true
if the key/value was successfully set, otherwise false
.See Also:
Boolean : setFloatColorValue( String key, DzFloatColor setting )
Sets a key with a float color value.
Parameter(s):
Return Value:
true
if the key/value was successfully set, otherwise false
.See Also:
Boolean : setFloatValue( String key, Number setting )
Sets a key with a floating point value.
Parameter(s):
Return Value:
true
if the key/value was successfully set, otherwise false
.See Also:
Boolean : setIntValue( String key, Number setting )
Sets a key with a integer value.
Parameter(s):
Return Value:
true
if the key/value was successfully set, otherwise false
.See Also:
Boolean : setStringValue( String key, String setting )
Sets a key with a string value.
Parameter(s):
Return Value:
true
if the key/value was successfully set, otherwise false
.See Also: