Open Lighting Architecture
Latest Git
|
Public Member Functions | |
Preferences (const std::string name) | |
virtual | ~Preferences () |
virtual bool | Load ()=0 |
virtual bool | Save () const =0 |
virtual void | Clear ()=0 |
virtual std::string | ConfigLocation () const =0 |
The location of where these preferences are stored. More... | |
virtual void | SetValue (const std::string &key, const std::string &value)=0 |
Set a preference value, overriding the existing value. More... | |
virtual void | SetValue (const std::string &key, unsigned int value)=0 |
Set a preference value, overriding the existing value. This helper accepts an unsigned int. More... | |
virtual void | SetValue (const std::string &key, int value)=0 |
Set a preference value, overriding the existing value. This helper accepts an int. More... | |
virtual void | SetMultipleValue (const std::string &key, const std::string &value)=0 |
Adds this preference value to the store. More... | |
virtual void | SetMultipleValue (const std::string &key, unsigned int value)=0 |
Adds this preference value to the store. This helper accepts an unsigned int. More... | |
virtual void | SetMultipleValue (const std::string &key, int value)=0 |
Adds this preference value to the store. This helper accepts an int. More... | |
virtual bool | SetDefaultValue (const std::string &key, const Validator &validator, const std::string &value)=0 |
Set a preference value if it doesn't already exist, or if it exists and doesn't pass the validator. More... | |
virtual bool | SetDefaultValue (const std::string &key, const Validator &validator, const char value[])=0 |
Set a preference value if it doesn't already exist, or if it exists and doesn't pass the validator. This helper accepts a char array to force it to a string. More... | |
virtual bool | SetDefaultValue (const std::string &key, const Validator &validator, unsigned int value)=0 |
Set a preference value if it doesn't already exist, or if it exists and doesn't pass the validator. This helper accepts an unsigned int value. More... | |
virtual bool | SetDefaultValue (const std::string &key, const Validator &validator, int value)=0 |
Set a preference value if it doesn't already exist, or if it exists and doesn't pass the validator. This helper accepts an int value. More... | |
virtual bool | SetDefaultValue (const std::string &key, const Validator &validator, bool value)=0 |
Set a preference value if it doesn't already exist, or if it exists and doesn't pass the validator. This helper accepts a bool value. More... | |
virtual std::string | GetValue (const std::string &key) const =0 |
Get a preference value. More... | |
virtual std::vector< std::string > | GetMultipleValue (const std::string &key) const =0 |
Returns all preference values corresponding to this key. More... | |
virtual bool | HasKey (const std::string &key) const =0 |
Check if a preference key exists. More... | |
virtual void | RemoveValue (const std::string &key)=0 |
Remove a preference value. More... | |
virtual bool | GetValueAsBool (const std::string &key) const =0 |
Get a preference value as a bool. More... | |
virtual void | SetValueAsBool (const std::string &key, bool value)=0 |
Set a value as a bool. More... | |
Protected Attributes | |
std::string | m_preference_name |
|
inlinevirtual |
Destroy this object
|
pure virtual |
Clear the preferences
Implemented in ola::MemoryPreferences.
|
pure virtual |
The location of where these preferences are stored.
Implemented in ola::FileBackedPreferences, and ola::MemoryPreferences.
|
pure virtual |
Returns all preference values corresponding to this key.
key | the key to fetch |
Implemented in ola::MemoryPreferences.
|
pure virtual |
Get a preference value.
key | the key to fetch |
Implemented in ola::MemoryPreferences.
|
pure virtual |
Get a preference value as a bool.
key | the key to fetch |
Implemented in ola::MemoryPreferences.
|
pure virtual |
Check if a preference key exists.
key | the key to check |
Implemented in ola::MemoryPreferences.
|
pure virtual |
Load the preferences from storage
Implemented in ola::FileBackedPreferences, and ola::MemoryPreferences.
|
pure virtual |
|
pure virtual |
Save the preferences to storage
Implemented in ola::FileBackedPreferences, and ola::MemoryPreferences.
|
pure virtual |
Set a preference value if it doesn't already exist, or if it exists and doesn't pass the validator.
key | the key to check/set |
validator | A Validator object |
value | the new value |
Implemented in ola::MemoryPreferences.
|
pure virtual |
Set a preference value if it doesn't already exist, or if it exists and doesn't pass the validator. This helper accepts a char array to force it to a string.
key | the key to check/set |
validator | A Validator object |
value | the new value |
Implemented in ola::MemoryPreferences.
|
pure virtual |
Set a preference value if it doesn't already exist, or if it exists and doesn't pass the validator. This helper accepts an unsigned int value.
key | the key to check/set |
validator | A Validator object |
value | the new value |
Implemented in ola::MemoryPreferences.
|
pure virtual |
Set a preference value if it doesn't already exist, or if it exists and doesn't pass the validator. This helper accepts an int value.
key | the key to check/set |
validator | A Validator object |
value | the new value |
Implemented in ola::MemoryPreferences.
|
pure virtual |
Set a preference value if it doesn't already exist, or if it exists and doesn't pass the validator. This helper accepts a bool value.
key | the key to check/set |
validator | A Validator object |
value | the new value |
Implemented in ola::MemoryPreferences.
|
pure virtual |
Adds this preference value to the store.
key | |
value |
Implemented in ola::MemoryPreferences.
|
pure virtual |
Adds this preference value to the store. This helper accepts an unsigned int.
key | |
value |
Implemented in ola::MemoryPreferences.
|
pure virtual |
Adds this preference value to the store. This helper accepts an int.
key | |
value |
Implemented in ola::MemoryPreferences.
|
pure virtual |
Set a preference value, overriding the existing value.
key | |
value |
Implemented in ola::MemoryPreferences.
|
pure virtual |
Set a preference value, overriding the existing value. This helper accepts an unsigned int.
key | |
value |
Implemented in ola::MemoryPreferences.
|
pure virtual |
Set a preference value, overriding the existing value. This helper accepts an int.
key | |
value |
Implemented in ola::MemoryPreferences.
|
pure virtual |