irods  4.2.8
About: iRODS (the integrated Rule Oriented Data System) is a distributed data-management system for creating data grids, digital libraries, persistent archives, and real-time data systems.
  Fossies Dox: irods-4.2.8.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

irods::configuration_parser Class Reference

#include <irods_configuration_parser.hpp>

Collaboration diagram for irods::configuration_parser:
[legend]

Public Types

typedef std::vector< std::string > key_path_t
 

Public Member Functions

 configuration_parser ()
 
 ~configuration_parser ()
 
 configuration_parser (const configuration_parser &)
 
 configuration_parser (const std::string &)
 
configuration_parseroperator= (const configuration_parser &)
 
void clear ()
 
error load (const std::string &)
 
error write (const std::string &)
 
error write ()
 
bool has_entry (const std::string &)
 
template<typename T >
T & set (const std::string &_key, const T &_val)
 
template<typename T >
T & set (const key_path_t &_keys, const T &_val)
 
template<typename T >
T & get (const std::string &_key)
 
template<typename T >
T & get (const key_path_t &_keys)
 
template<typename T >
remove (const std::string &_key)
 
void remove (const std::string &_key)
 
std::unordered_map< std::string, boost::any > & map ()
 

Private Member Functions

error load_json_object (const std::string &)
 
boost::any convert_json (const nlohmann::json &)
 
error copy_and_swap (const std::unordered_map< std::string, boost::any > &)
 

Private Attributes

std::string file_name_
 
std::unordered_map< std::string, boost::any > root_
 

Detailed Description

Definition at line 20 of file irods_configuration_parser.hpp.

Member Typedef Documentation

◆ key_path_t

typedef std::vector< std::string > irods::configuration_parser::key_path_t

Definition at line 22 of file irods_configuration_parser.hpp.

Constructor & Destructor Documentation

◆ configuration_parser() [1/3]

irods::configuration_parser::configuration_parser ( )

Definition at line 17 of file irods_configuration_parser.cpp.

◆ ~configuration_parser()

irods::configuration_parser::~configuration_parser ( )

Definition at line 21 of file irods_configuration_parser.cpp.

◆ configuration_parser() [2/3]

irods::configuration_parser::configuration_parser ( const configuration_parser _rhs)

Definition at line 25 of file irods_configuration_parser.cpp.

References copy_and_swap(), irods::log(), irods::error::ok(), PASS, and root_.

Here is the call graph for this function:

◆ configuration_parser() [3/3]

irods::configuration_parser::configuration_parser ( const std::string &  _file)

Definition at line 35 of file irods_configuration_parser.cpp.

References load().

Here is the call graph for this function:

Member Function Documentation

◆ clear()

void irods::configuration_parser::clear ( )

Definition at line 51 of file irods_configuration_parser.cpp.

References root_.

◆ convert_json()

boost::any irods::configuration_parser::convert_json ( const nlohmann::json _json)
private

Definition at line 126 of file irods_configuration_parser.cpp.

References irods::experimental::filesystem::client::begin(), irods::experimental::filesystem::client::end(), THROW, and type.

Referenced by load_json_object().

Here is the call graph for this function:

◆ copy_and_swap()

error irods::configuration_parser::copy_and_swap ( const std::unordered_map< std::string, boost::any > &  _rhs)
private

Definition at line 57 of file irods_configuration_parser.cpp.

References root_, and SUCCESS.

Referenced by configuration_parser(), and operator=().

◆ get() [1/2]

template<typename T >
T& irods::configuration_parser::get ( const key_path_t _keys)
inline

Definition at line 88 of file irods_configuration_parser.hpp.

References INVALID_ANY_CAST, KEY_NOT_FOUND, root_, and THROW.

◆ get() [2/2]

template<typename T >
T& irods::configuration_parser::get ( const std::string &  _key)
inline

◆ has_entry()

bool irods::configuration_parser::has_entry ( const std::string &  _key)

Definition at line 67 of file irods_configuration_parser.cpp.

References root_.

◆ load()

error irods::configuration_parser::load ( const std::string &  _file)

Definition at line 72 of file irods_configuration_parser.cpp.

References ERROR, load_json_object(), and SYS_INVALID_INPUT_PARAM.

Referenced by irods::environment_properties::capture_json(), irods::server_properties::capture_json(), checkHostAccessControl(), configuration_parser(), and initHostConfigByFile().

Here is the call graph for this function:

◆ load_json_object()

error irods::configuration_parser::load_json_object ( const std::string &  _file)
private

Definition at line 83 of file irods_configuration_parser.cpp.

References convert_json(), terminate_irods_processes::e, ERROR, error, INVALID_ANY_CAST, root_, and SUCCESS.

Referenced by load().

Here is the call graph for this function:

◆ map()

std::unordered_map<std::string, boost::any>& irods::configuration_parser::map ( )
inline

Definition at line 131 of file irods_configuration_parser.hpp.

References root_.

Referenced by irods::environment_properties::map().

◆ operator=()

configuration_parser & irods::configuration_parser::operator= ( const configuration_parser _rhs)

Definition at line 42 of file irods_configuration_parser.cpp.

References copy_and_swap(), and root_.

Here is the call graph for this function:

◆ remove() [1/2]

template<typename T >
T irods::configuration_parser::remove ( const std::string &  _key)
inline

◆ remove() [2/2]

void irods::configuration_parser::remove ( const std::string &  _key)

Definition at line 178 of file irods_configuration_parser.cpp.

References KEY_NOT_FOUND, root_, and THROW.

◆ set() [1/2]

template<typename T >
T& irods::configuration_parser::set ( const key_path_t _keys,
const T &  _val 
)
inline

Definition at line 47 of file irods_configuration_parser.hpp.

References INVALID_ANY_CAST, root_, and THROW.

◆ set() [2/2]

template<typename T >
T& irods::configuration_parser::set ( const std::string &  _key,
const T &  _val 
)
inline

◆ write() [1/2]

error irods::configuration_parser::write ( )

◆ write() [2/2]

error irods::configuration_parser::write ( const std::string &  )

Member Data Documentation

◆ file_name_

std::string irods::configuration_parser::file_name_
private

Definition at line 144 of file irods_configuration_parser.hpp.

◆ root_

std::unordered_map<std::string, boost::any> irods::configuration_parser::root_
private

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