A configuration provider.
More...
#include <Configuration.h>
Inherited by libcdoc::JSONConfiguration.
|
| | Configuration ()=default |
| virtual | ~Configuration () noexcept=default |
| | Configuration (const Configuration &)=delete |
| Configuration & | operator= (const Configuration &)=delete |
| | CDOC_DISABLE_MOVE (Configuration) |
| virtual std::string | getValue (std::string_view domain, std::string_view param) const |
| | get a value of configuration parameter
|
| std::string | getValue (std::string_view param) const |
| | get a value of configuration parameter from the default domain
|
| bool | getBoolean (std::string_view param, bool def_val=false) const |
| | get boolean value of configuration parameter from the default domain
|
| int | getInt (std::string_view param, int def_val=0) const |
| | get integer value of configuration parameter from the default domain
|
|
| static constexpr char const * | KEYSERVER_SEND_URL = "KEYSERVER_SEND_URL" |
| | Send URL of keyserver (Domain is server id).
|
| static constexpr char const * | KEYSERVER_FETCH_URL = "KEYSERVER_FETCH_URL" |
| | Fetch URL of keyserver (Domain is server id).
|
A configuration provider.
Subclasses can implement different configuration systems (registry, .ini files etc.) by overriding getValue.
◆ Configuration() [1/2]
| libcdoc::Configuration::Configuration |
( |
| ) |
|
|
default |
◆ ~Configuration()
| virtual libcdoc::Configuration::~Configuration |
( |
| ) |
|
|
virtualdefaultnoexcept |
◆ Configuration() [2/2]
| libcdoc::Configuration::Configuration |
( |
const Configuration & | | ) |
|
|
delete |
◆ CDOC_DISABLE_MOVE()
◆ getBoolean()
| bool libcdoc::Configuration::getBoolean |
( |
std::string_view | param, |
|
|
bool | def_val = false ) const |
get boolean value of configuration parameter from the default domain
- Parameters
-
| param | the parameter name |
| def_val | the default value to return if parameter is not set |
- Returns
- the parameter value
◆ getInt()
| int libcdoc::Configuration::getInt |
( |
std::string_view | param, |
|
|
int | def_val = 0 ) const |
get integer value of configuration parameter from the default domain
- Parameters
-
| param | the parameter name |
| def_val | the default value to return if parameter is not set |
- Returns
- the key value
◆ getValue() [1/2]
| virtual std::string libcdoc::Configuration::getValue |
( |
std::string_view | domain, |
|
|
std::string_view | param ) const |
|
inlinevirtual |
get a value of configuration parameter
Get a string value of configuration parameter.
- Parameters
-
| domain | the parameter domain. For keyservers this is the server ID. |
| param | the parameter name. |
- Returns
- a string value or empty string if parameter is not defined.
Reimplemented in libcdoc::JSONConfiguration.
References getValue().
Referenced by getValue().
◆ getValue() [2/2]
| std::string libcdoc::Configuration::getValue |
( |
std::string_view | param | ) |
const |
|
inline |
get a value of configuration parameter from the default domain
- Parameters
-
- Returns
- a string value or empty string if parameter is not defined.
References getValue().
Referenced by getValue().
◆ operator=()
◆ KEYSERVER_FETCH_URL
| char const* libcdoc::Configuration::KEYSERVER_FETCH_URL = "KEYSERVER_FETCH_URL" |
|
staticconstexpr |
Fetch URL of keyserver (Domain is server id).
◆ KEYSERVER_SEND_URL
| char const* libcdoc::Configuration::KEYSERVER_SEND_URL = "KEYSERVER_SEND_URL" |
|
staticconstexpr |
Send URL of keyserver (Domain is server id).
The documentation for this struct was generated from the following file: