MySQL 8.4.0
Source Code Documentation
keyring_common::config::Config_reader Class Reference

#include <config_reader.h>

Public Member Functions

 Config_reader (const std::string config_file_path)
 Constructor. More...
 
template<typename T >
bool get_element (const std::string element_name, T &element_value)
 Get an element value from JSON document. More...
 

Private Attributes

std::string config_file_path_
 Configuration file path. More...
 
rapidjson::Document data_
 Configuration data in JSON. More...
 
bool valid_
 Validity of configuration data. More...
 

Constructor & Destructor Documentation

◆ Config_reader()

keyring_common::config::Config_reader::Config_reader ( const std::string  config_file_path)
explicit

Constructor.

Reads JSON from config file and stores it in memory.

Parameters
[in]config_file_pathFull path to configuration file

Member Function Documentation

◆ get_element()

template<typename T >
bool keyring_common::config::Config_reader::get_element ( const std::string  element_name,
T &  element_value 
)
inline

Get an element value from JSON document.

Assumption: Type is compatible with Get() function and type of element is matching with template argument.

Parameters
[in]element_nameName of the element being searched
[out]element_valueValue of the element
Returns
status of search operation
Return values
falseElement found. Refer to element_value
trueElement missing.

Member Data Documentation

◆ config_file_path_

std::string keyring_common::config::Config_reader::config_file_path_
private

Configuration file path.

◆ data_

rapidjson::Document keyring_common::config::Config_reader::data_
private

Configuration data in JSON.

◆ valid_

bool keyring_common::config::Config_reader::valid_
private

Validity of configuration data.


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