Open Lighting Architecture: ola::FileBackedPreferences Class Reference

| Open Lighting Architecture 0.10.9

Loading...
Searching...
No Matches
Public Member Functions | List of all members
ola::FileBackedPreferences Class Reference
Inheritance diagram for ola::FileBackedPreferences:

## Public Member Functions
| FileBackedPreferences (const std::string &directory, const std::string &name, FilePreferenceSaverThread *saver_thread)
virtual bool | Load ()
virtual bool | Save () const
bool | LoadFromFile (const std::string &filename)
| Load these preferences from a file.
std::string | ConfigLocation () const
| The location of where these preferences are stored.
Public Member Functions inherited from ola::MemoryPreferences
| MemoryPreferences (const std::string name)
virtual void | Clear ()
virtual void | SetValue (const std::string &key, const std::string &value)
| Set a preference value, overriding the existing value.
virtual void | SetValue (const std::string &key, unsigned int value)
| Set a preference value, overriding the existing value. This helper accepts an unsigned int.
virtual void | SetValue (const std::string &key, int value)
| Set a preference value, overriding the existing value. This helper accepts an int.
virtual void | SetMultipleValue (const std::string &key, const std::string &value)
| Adds this preference value to the store.
virtual void | SetMultipleValue (const std::string &key, unsigned int value)
| Adds this preference value to the store. This helper accepts an unsigned int.
virtual void | SetMultipleValue (const std::string &key, int value)
| Adds this preference value to the store. This helper accepts an int.
virtual bool | SetDefaultValue (const std::string &key, const Validator &validator, const std::string &value)
| Set a preference value if it doesn't already exist, or if it exists and doesn't pass the validator.
virtual bool | SetDefaultValue (const std::string &key, const Validator &validator, const char value[])
| 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.
virtual bool | SetDefaultValue (const std::string &key, const Validator &validator, unsigned int value)
| 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.
virtual bool | SetDefaultValue (const std::string &key, const Validator &validator, int value)
| 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.
virtual bool | SetDefaultValue (const std::string &key, const Validator &validator, bool value)
| 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.
virtual std::string | GetValue (const std::string &key) const
| Get a preference value.
virtual std::vector< std::string > | GetMultipleValue (const std::string &key) const
| Returns all preference values corresponding to this key.
virtual bool | HasKey (const std::string &key) const
| Check if a preference key exists.
virtual void | RemoveValue (const std::string &key)
| Remove a preference value.
virtual bool | GetValueAsBool (const std::string &key) const
| Get a preference value as a bool.
virtual void | SetValueAsBool (const std::string &key, bool value)
| Set a value as a bool.
bool | operator== (const MemoryPreferences &other)
Public Member Functions inherited from ola::Preferences
| Preferences (const std::string name)
virtual | ~Preferences ()

## Additional Inherited Members
Protected Types inherited from ola::MemoryPreferences
typedef std::multimap< std::string, std::string > | PreferencesMap
Protected Attributes inherited from ola::MemoryPreferences
PreferencesMap | m_pref_map
Protected Attributes inherited from ola::Preferences
std::string | m_preference_name

## Member Function Documentation

## ◆ ConfigLocation()

std::string ola::FileBackedPreferences::ConfigLocation | ( |  | ) | const
| inlinevirtual

The location of where these preferences are stored.

Returns
  the location

Reimplemented from ola::MemoryPreferences.

## ◆ Load()

bool ola::FileBackedPreferences::Load | ( |  | ) |
| virtual

Load the preferences from storage

Reimplemented from ola::MemoryPreferences.

## ◆ LoadFromFile()

bool ola::FileBackedPreferences::LoadFromFile | ( | const std::string & | filename | ) |

Load these preferences from a file.

Parameters

  filename | the filename to load from

## ◆ Save()

bool ola::FileBackedPreferences::Save | ( |  | ) | const
| virtual

Save the preferences to storage

Reimplemented from ola::MemoryPreferences.

The documentation for this class was generated from the following files:

- include/olad/Preferences.h
- olad/plugin_api/Preferences.cpp