CAVAPA-GUI  30.5.2014
 All Classes Namespaces Functions Variables Typedefs Enumerations Pages
Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
cavapa_gui::Settings Class Reference

Provides methods for loading and saving the application settings. More...

#include <settings.h>

Inheritance diagram for cavapa_gui::Settings:
cavapa_gui::KeyValueCollection cavapa_gui::GeneralSettings cavapa_gui::SourceSettings

Public Member Functions

std::vector< std::string > getVector (const std::string &key) const
 Gets a collection of values related to the specified key. More...
 
void setVector (const std::string &key, const std::vector< std::string > &vector)
 Sets a collection of values related to the specified key. More...
 
- Public Member Functions inherited from cavapa_gui::KeyValueCollection
const_iterator begin () const
 Returns a const iterator to the beginning of the collection. More...
 
const_iterator end () const
 Returns a const iterator to the end of the collection. More...
 
std::string get (const std::string &name) const
 Gets the value of the specified key as a string. More...
 
bool getBool (const std::string &name) const
 Gets the value of the specified key as a bool. More...
 
QColor getColor (const std::string &name) const
 Gets the value of the specified key as a QColor. More...
 
QString getQString (const std::string &name) const
 Gets the value of the specified key as a QString. More...
 
double getDouble (const std::string &name) const
 Gets the value of the specified key as a double. More...
 
int getInt (const std::string &name) const
 Gets the value of the specified key as an integer. More...
 
template<typename ValueType , int N>
std::array< ValueType, N > getValues (const std::string &name) const
 Gets an array of values from the specified key. More...
 
void set (const std::string &name, const std::string &value)
 Sets the value of the specified key. More...
 
void setBool (const std::string &name, bool value)
 Sets the value of the specified key as a bool. More...
 
void setColor (const std::string &name, const QColor &value)
 Sets the value of the specified key as a QColor. More...
 
void setInt (const std::string &name, int value)
 Sets the value of the specified key as an int. More...
 
template<typename... T>
void setValues (const std::string &name, T...values)
 Sets the value of the specified key as an array. More...
 
void setQString (const std::string &name, const QString &value)
 Sets the value of the specified key as a QString. More...
 
bool trySet (const std::string &name, const std::string &value)
 Attempts to set the value of the specified key. More...
 

Protected Member Functions

virtual std::string getGroupName ()
 Gets the name of the setting group. More...
 

Protected Attributes

std::map< std::string,
std::vector< std::string > > 
vectorMap
 The map associates a string key with a vector of strings. More...
 
- Protected Attributes inherited from cavapa_gui::KeyValueCollection
std::map< std::string,
std::string > 
keyValueMap
 Contains the key-value mappings in an std::map.
 

Friends

class Controller
 

Additional Inherited Members

- Public Types inherited from cavapa_gui::KeyValueCollection
using const_iterator = std::map< std::string, std::string >::const_iterator
 Provides a bidirectional iterator that can read a const element in the collection.
 

Detailed Description

Provides methods for loading and saving the application settings.

Author
Mika Lehtinen

Member Function Documentation

virtual std::string cavapa_gui::Settings::getGroupName ( )
inlineprotectedvirtual

Gets the name of the setting group.

Returns
The name of the setting group. The default value is an empty string.

Reimplemented in cavapa_gui::SourceSettings.

std::vector< std::string > cavapa_gui::Settings::getVector ( const std::string &  key) const

Gets a collection of values related to the specified key.

Parameters
keyThe key whose values are to be fetched.
Returns
The collection of values as a vector.
void cavapa_gui::Settings::setVector ( const std::string &  key,
const std::vector< std::string > &  vector 
)

Sets a collection of values related to the specified key.

Parameters
keyThe key whose values are to be set.
vectorThe collection of values as a vector.

Member Data Documentation

std::map<std::string, std::vector<std::string> > cavapa_gui::Settings::vectorMap
protected

The map associates a string key with a vector of strings.

It is used to save arrays of values in the settings.


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