A Configuration object implementation that reads values from JSON file.
More...
#include <Configuration.h>
Inherits libcdoc::Configuration.
|
| 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 object implementation that reads values from JSON file.
The file should represent a single object with key/value pairs Domains are sub-objects with corresponding key/value pairs Strings are returned unquoted, everything else is returned as JSON
◆ JSONConfiguration() [1/4]
| libcdoc::JSONConfiguration::JSONConfiguration |
( |
| ) |
|
◆ JSONConfiguration() [2/4]
| libcdoc::JSONConfiguration::JSONConfiguration |
( |
std::istream & |
ifs | ) |
|
◆ JSONConfiguration() [3/4]
| libcdoc::JSONConfiguration::JSONConfiguration |
( |
const std::string & |
file | ) |
|
◆ JSONConfiguration() [4/4]
| libcdoc::JSONConfiguration::JSONConfiguration |
( |
const std::vector< uint8_t > & |
data | ) |
|
◆ ~JSONConfiguration()
| libcdoc::JSONConfiguration::~JSONConfiguration |
( |
| ) |
|
◆ getValue()
| std::string libcdoc::JSONConfiguration::getValue |
( |
std::string_view |
domain, |
|
|
std::string_view |
param |
|
) |
| const |
|
overridevirtual |
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 from libcdoc::Configuration.
◆ parse() [1/3]
| bool libcdoc::JSONConfiguration::parse |
( |
const std::string & |
file | ) |
|
Read configuration data from file.
Existing values are replaced
- Parameters
-
- Returns
- true if successful
◆ parse() [2/3]
| bool libcdoc::JSONConfiguration::parse |
( |
const std::vector< uint8_t > & |
data | ) |
|
Read configuration data from byte vector.
Existing values are replaced
- Parameters
-
- Returns
- true if successful
◆ parse() [3/3]
| bool libcdoc::JSONConfiguration::parse |
( |
std::istream & |
ifs | ) |
|
Read configuration data from input stream.
Existing values are replaced
- Parameters
-
- Returns
- true if successful
The documentation for this struct was generated from the following file: