Inheritance diagram for DzSettings:
Enumerations | |
enum | Type { StringValue, IntValue, BoolValue, FloatValue } |
Constructors | |
DzSettings () | |
Methods | |
Boolean | fromString (String settings) |
Boolean | getBoolValue (String key, Boolean def=false) |
Number | getFloatValue (String key, Number def=0.0) |
Number | getIntValue (String key, Number def=0) |
String | getKey (Number which) |
Number | getNumValues () |
Number | getSettingIndex (String key) |
DzSettings | getSettingsValue (String key) |
String | getStringValue (String key, String def="") |
String | getValue (Number which) |
Type | getValueType (Number which) |
void | removeValue (String key) |
void | setBoolValue (String key, Boolean value) |
void | setFloatValue (String key, Number value) |
void | setIntValue (String key, Number value) |
DzSettings | setSettingsValue (String key) |
DzSettings | setSettingsValue (String key, DzSettings settings) |
void | setStringValue (String key, String value) |
void | toScript (String varName, DzScript script, Number indent, Boolean writeCreatation=false) |
String | toString () |
enum DzSettings::Type |
Enumerated types of the values stored in the DzSettings class.
DzSettings::DzSettings | ( | ) |
Constructor
Populates this settings object with the data encoded by the given string.
settings | The settings string to load the data from. |
Gets a boolean value from the settings.
key | The key string. | |
def | The default value that is returned if the key does not exist. |
Gets a float value from the settings.
key | The key string. | |
def | The default value that is returned if the key does not exist. |
Gets an integer value from the settings.
key | The key string. | |
def | The default value that is returned if the key does not exist. |
which | The index of the value to get the key for. |
Number DzSettings::getNumValues | ( | ) |
key | The key of the value to find |
DzSettings DzSettings::getSettingsValue | ( | String | key | ) |
Gets a float value from the settings.
key | The key string. |
Gets a string value from the settings.
key | The key string. | |
def | The default value that is returned if the key does not exist. |
which | The index of the value to get. |
which | The index of the value to get the type of. |
void DzSettings::removeValue | ( | String | key | ) |
Removes a value
key | The key string to remove |
Adds a boolean value.
key | The key string. | |
value | The value for the setting. |
Adds a float value.
key | The key string. | |
value | The value for the setting. |
Adds an integer value.
key | The key string. | |
value | The value for the setting. |
void DzSettings::setSettingsValue | ( | String | key | ) |
Adds a float value.
key | The key string. | |
return | An empty created settings object at the given key |
void DzSettings::setSettingsValue | ( | String | key, | |
DzSettings | settings | |||
) |
Adds a float value.
key | The key string. | |
settings | The value for the setting. A local copy is made of this setting | |
return | The created settings or NULL if setting if settings was null |
Adds a string value.
key | The key string. | |
value | The value for the setting. |
void DzSettings::toScript | ( | String | varName, | |
DzScript | script, | |||
Number | indent, | |||
Boolean | writeCreatation = false | |||
) |
Writes this DzSetting to the handed script file. After the lines it adds there will be a valid script object by name varName that is equal to this DzSettings object.
varName | The name of the variable to set the settings on | |
script | Script to write these settings to. | |
ident | Indent level for the generated lines. | |
writeCreatation | Writes the creation statement at the top, if this is false it is the caller's reposibility to make sure there is script object by varName that points to a legal DzSettings object. |
String DzSettings::toString | ( | ) |
Reimplemented from Object.