Electroneum
epee::tiny_ini Namespace Reference

Functions

bool get_param_value (const std::string &param_name, const std::string &ini_entry, std::string &res)
 
std::string get_param_value (const std::string &param_name, const std::string &ini_entry)
 
template<class T >
bool get_param_value_as_t (const std::string &param_name, const std::string &ini_entry, T &res)
 

Function Documentation

◆ get_param_value() [1/2]

bool epee::tiny_ini::get_param_value ( const std::string &  param_name,
const std::string &  ini_entry,
std::string &  res 
)
inline

Definition at line 41 of file tiny_ini.h.

42  {
43  std::string expr_str = std::string() + "^("+ param_name +") *=(.*?)$";
44  const boost::regex match_ini_entry( expr_str, boost::regex::icase | boost::regex::normal);
45  boost::smatch result;
46  if(!boost::regex_search(ini_entry, result, match_ini_entry, boost::match_default))
47  return false;
48  res = result[2];
50  return true;
51  }
const char * res
Definition: hmac_keccak.cpp:41
::std::string string
Definition: gtest-port.h:1097
std::string & trim(std::string &str)
Definition: string_tools.h:288
Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_param_value() [2/2]

std::string epee::tiny_ini::get_param_value ( const std::string &  param_name,
const std::string &  ini_entry 
)
inline

Definition at line 53 of file tiny_ini.h.

54  {
55  std::string buff;
56  get_param_value(param_name, ini_entry, buff);
57  return buff;
58  }
::std::string string
Definition: gtest-port.h:1097
std::string get_param_value(const std::string &param_name, const std::string &ini_entry)
Definition: tiny_ini.h:53
Here is the call graph for this function:

◆ get_param_value_as_t()

template<class T >
bool epee::tiny_ini::get_param_value_as_t ( const std::string &  param_name,
const std::string &  ini_entry,
T res 
)

Definition at line 61 of file tiny_ini.h.

62  {
63  std::string str_res = get_param_value(param_name, ini_entry);
64 
65  string_tools::trim(str_res);
66  if(!str_res.size())
67  return false;
68 
70  }
const char * res
Definition: hmac_keccak.cpp:41
::std::string string
Definition: gtest-port.h:1097
std::string & trim(std::string &str)
Definition: string_tools.h:288
std::string get_param_value(const std::string &param_name, const std::string &ini_entry)
Definition: tiny_ini.h:53
PUSH_WARNINGS bool get_xtype_from_string(OUT XType &val, const std::string &str_id)
Definition: string_tools.h:125
Here is the call graph for this function: