|
libcdoc
0.1.8
|
A Configuration object implementation that reads values from JSON file. More...
#include <Configuration.h>
Public Member Functions | |
| JSONConfiguration () | |
| Construct a new empty JSONConfiguration object. More... | |
| JSONConfiguration (std::istream &ifs) | |
| Construct a new JSONConfiguration object from input stream. More... | |
| JSONConfiguration (const std::string &file) | |
| Construct a new JSONConfiguration object from file. More... | |
| JSONConfiguration (const std::vector< uint8_t > &data) | |
| Construct a new JSONConfiguration object from bytes. More... | |
| ~JSONConfiguration () | |
| bool | parse (std::istream &ifs) |
| Read configuration data from input stream. More... | |
| bool | parse (const std::string &file) |
| Read configuration data from file. More... | |
| bool | parse (const std::vector< uint8_t > &data) |
| Read configuration data from byte vector. More... | |
| std::string | getValue (std::string_view domain, std::string_view param) const override |
| get a value of configuration parameter More... | |
Public Member Functions inherited from libcdoc::Configuration | |
| Configuration ()=default | |
| virtual | ~Configuration () noexcept=default |
| Configuration (const Configuration &)=delete | |
| Configuration & | operator= (const Configuration &)=delete |
| CDOC_DISABLE_MOVE (Configuration) | |
| std::string | getValue (std::string_view param) const |
| get a value of configuration parameter from default domain More... | |
| bool | getBoolean (std::string_view param, bool def_val=false) const |
| get boolean value of configuration parameter from default domain More... | |
| int | getInt (std::string_view param, int def_val=0) const |
| get integer value of configuration parameter from default domain More... | |
Additional Inherited Members | |
Static Public Attributes inherited from libcdoc::Configuration | |
| static constexpr char const * | KEYSERVER_SEND_URL = "KEYSERVER_SEND_URL" |
| Send URL of keyserver (Domain is server id) More... | |
| static constexpr char const * | KEYSERVER_FETCH_URL = "KEYSERVER_FETCH_URL" |
| Fetch URL of keyserver (Domain is server id) More... | |
| static constexpr char const * | SHARE_SERVER_URLS = "SHARE_SERVER_URLS" |
| JSON array of share server base urls (Domain is server id) More... | |
| static constexpr char const * | SHARE_SIGNER = "SHARE_SIGNER" |
| Method for signing keyshare tickets (SMART_ID or MOBILE_ID) More... | |
| static constexpr char const * | SID_DOMAIN = "SMART_ID" |
| Domain of SmartID settings. More... | |
| static constexpr char const * | MID_DOMAIN = "MOBILE_ID" |
| Domain of Mobile ID settings. More... | |
| static constexpr char const * | BASE_URL = "BASE_URL" |
| MID/SID base url (domain is SMART_ID or MOBILE_ID) More... | |
| static constexpr char const * | RP_UUID = "RP_UUID" |
| MID/SID relying party UUID (domain is SMART_ID or MOBILE_ID) More... | |
| static constexpr char const * | RP_NAME = "RP_NAME" |
| MID/SID relying party name (domain is SMART_ID or MOBILE_ID) More... | |
| static constexpr char const * | PHONE_NUMBER = "PHONE_NUMBER" |
| Mobile ID phone number (domain is MOBILE_ID) More... | |
A Configuration object implementation that reads values from JSON file.
The file should represent a single object with key/value pairs Domain should contain sub-objects with corresponding key/value pairs Strings are returned unquoted, everything else is returned as JSON
| libcdoc::JSONConfiguration::JSONConfiguration | ( | ) |
Construct a new empty JSONConfiguration object.
| libcdoc::JSONConfiguration::JSONConfiguration | ( | std::istream & | ifs | ) |
Construct a new JSONConfiguration object from input stream.
| ifs | input stream |
| libcdoc::JSONConfiguration::JSONConfiguration | ( | const std::string & | file | ) |
Construct a new JSONConfiguration object from file.
| file | file name |
| libcdoc::JSONConfiguration::JSONConfiguration | ( | const std::vector< uint8_t > & | data | ) |
Construct a new JSONConfiguration object from bytes.
| data | input data |
| libcdoc::JSONConfiguration::~JSONConfiguration | ( | ) |
|
overridevirtual |
get a value of configuration parameter
Get a string value of configuration parameter.
| domain | the parameter domain. For keyservers this is the server ID. |
| param | the parameter name. |
Reimplemented from libcdoc::Configuration.
| bool libcdoc::JSONConfiguration::parse | ( | std::istream & | ifs | ) |
Read configuration data from input stream.
Existing values are replaced
| ifs | input stream |
| bool libcdoc::JSONConfiguration::parse | ( | const std::string & | file | ) |
Read configuration data from file.
Existing values are replaced
| file | file name |
| bool libcdoc::JSONConfiguration::parse | ( | const std::vector< uint8_t > & | data | ) |
Read configuration data from byte vector.
Existing values are replaced
| data | input data |