Cupt
config.hpp
Go to the documentation of this file.
1/**************************************************************************
2* Copyright (C) 2010 by Eugene V. Lyubimkin *
3* *
4* This program is free software; you can redistribute it and/or modify *
5* it under the terms of the GNU General Public License *
6* (version 3 or above) as published by the Free Software Foundation. *
7* *
8* This program is distributed in the hope that it will be useful, *
9* but WITHOUT ANY WARRANTY; without even the implied warranty of *
10* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
11* GNU General Public License for more details. *
12* *
13* You should have received a copy of the GNU GPL *
14* along with this program; if not, write to the *
15* Free Software Foundation, Inc., *
16* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA *
17**************************************************************************/
18#ifndef CUPT_CONFIG_SEEN
19#define CUPT_CONFIG_SEEN
20
22
23#include <cupt/common.hpp>
24
25namespace cupt {
26
27namespace internal {
28
29class ConfigImpl;
30
31}
32
34class CUPT_API Config
35{
36 internal::ConfigImpl* __impl;
37 public:
39
44 virtual ~Config();
45
47 Config(const Config& other);
49 Config& operator=(const Config& other);
50
52 vector<string> getScalarOptionNames() const;
54 vector<string> getListOptionNames() const;
55
57
61 void setScalar(const string& optionName, const string& value);
63
67 void setList(const string& optionName, const string& value);
68
70
73 vector< string > getList(const string& optionName) const;
75
78 string getString(const string& optionName) const;
80
83 bool getBool(const string& optionName) const;
85
88 ssize_t getInteger(const string& optionName) const;
90
93 string getPath(const string& optionName) const;
95
98 vector<string> getConfigurationPartPaths(const string& optionName) const;
99};
100
101} // namespace
102
103#endif
104
stores library's configuration variables
Definition config.hpp:35
ssize_t getInteger(const string &optionName) const
gets converted to integer value of the scalar option
vector< string > getConfigurationPartPaths(const string &optionName) const
gets paths of non-ignored configuration part files
void setScalar(const string &optionName, const string &value)
sets new value for the scalar option
string getPath(const string &optionName) const
gets resolved value of the path variable
virtual ~Config()
destructor
vector< string > getScalarOptionNames() const
returns scalar option names
vector< string > getList(const string &optionName) const
gets contents of the list variable
bool getBool(const string &optionName) const
gets converted to boolean value of the scalar option
Config & operator=(const Config &other)
assignment operator
vector< string > getListOptionNames() const
returns list option names
string getString(const string &optionName) const
gets value of the scalar option
void setList(const string &optionName, const string &value)
appends new element to the value of the list option
Config(const Config &other)
copy constructor
Config()
constructor