47#include <snapdev/poison.h>
84 for(
char const *
n(name.c_str()); *
n !=
'\0'; ++
n)
86 if(*
n ==
':' || *
n ==
'.')
91 "found an empty section name in \""
95 while(
n[1] ==
':' ||
n[1] ==
'.')
104 if(
first && *
n >=
'0' && *
n <=
'9')
107 "a variable name or section name in \""
109 +
"\" starts with a digit, which is not allowed.");
162 return std::string();
213 std::string
const & name
214 , std::string
const & value
249 +
"\" is already defined.");
317 std::string
const & value
322 for(
char const *
s(value.c_str()); *
s !=
'\0'; ++
s)
325 if(
c ==
'$' &&
s[1] ==
'{')
328 char const * name(
s);
329 for(; *
s !=
'}' && *
s !=
'\0'; ++
s);
346 std::string
var(std::string(name,
s - name));
355 result +=
"<variable \"" +
var +
"\" loops>";
std::string process_value(std::string const &value) const
Process variables against a parameter.
void set_variable(std::string const &name, std::string const &value, assignment_t assignment=assignment_t::ASSIGNMENT_SET)
Set a variable.
variable_t const & get_variables() const
Return a reference to the map of variables.
std::string recursive_process_value(std::string const &value, variable_names_t &names) const
Internal function processing variables recursively.
string_set_t variable_names_t
std::map< std::string, std::string > variable_t
std::string get_variable(std::string const &name) const
Return the value of the named variable.
static std::string canonicalize_variable_name(std::string const &name)
Canonicalize the variable name.
bool has_variable(std::string const &name) const
Check whether a variable is defined.
Definitions of the advanced getopt exceptions.
The advgetopt environment to parse command line options.
constexpr flag_t option_flags_merge()
Declaration of the variable class.