19 #ifndef SBUILD_ENVIRONMENT_H 20 #define SBUILD_ENVIRONMENT_H 22 #include <sbuild/sbuild-log.h> 23 #include <sbuild/sbuild-parse-value.h> 24 #include <sbuild/sbuild-regex.h> 30 #include <boost/format.hpp> 41 using std::map<std::string, std::string>::value_type;
85 add (
char **environment);
94 add (environment
const& environment);
103 add (value_type
const& value);
113 add (std::string
const& name,
114 std::string
const& value)
116 add(std::make_pair(name, value));
128 add (std::string
const& name,
131 std::ostringstream varstring;
132 varstring.imbue(std::locale::classic());
133 varstring << std::boolalpha << value;
134 add(std::make_pair(name, varstring.str()));
145 add (std::string
const& value);
173 remove (std::string
const& value);
182 remove (value_type
const& value);
192 template <
typename T>
194 get (std::string
const& name,
199 const_iterator pos = find(name);
234 template <
typename T>
248 template <
typename T>
263 template <
typename T>
268 environment ret(lhs);
280 template <
typename T>
285 environment ret(lhs);
297 template <
class charT,
class traits>
299 std::basic_ostream<charT,traits>&
300 operator << (std::basic_ostream<charT,traits>& stream,
301 environment
const& rhs)
303 for (environment::const_iterator pos = rhs.begin();
307 stream << pos->first <<
'=' << pos->second <<
'\n';
POSIX extended regular expression.
Definition: sbuild-regex.h:66
regex const & get_filter() const
Get environment filter.
Definition: sbuild-environment.cc:51
Debian source builder components.
Definition: sbuild-auth-null.h:24
environment & operator+=(T const &rhs)
Add variables to the environment.
Definition: sbuild-environment.h:236
environment()
The constructor.
Definition: sbuild-environment.cc:28
regex filter
Filter regex.
Definition: sbuild-environment.h:315
void set_filter(regex const &filter)
Set environment filter.
Definition: sbuild-environment.cc:45
Notification messages.
Definition: sbuild-log.h:31
char ** get_strv() const
Get the evironment variables as a string vector.
Definition: sbuild-environment.cc:159
std::ostream & log_debug(debug_level level)
Log a debug message.
Definition: sbuild-log.cc:110
Container of environment variables.
Definition: sbuild-environment.h:38
~environment()
The destructor.
Definition: sbuild-environment.cc:40
void add(std::string const &name, T const &value)
Add environment variable.
Definition: sbuild-environment.h:128
void add(char **environment)
Add environment variables.
Definition: sbuild-environment.cc:57
friend environment operator+(environment const &lhs, T const &rhs)
Add variables to the environment.
Definition: sbuild-environment.h:265
Parse error.
Definition: sbuild-parse-error.h:35
Informational messages.
Definition: sbuild-log.h:32
void parse_value(std::string const &value, bool &parsed_value)
Parse a boolean value.
Definition: sbuild-parse-value.cc:49
environment & operator-=(T const &rhs)
Remove variables from the environment.
Definition: sbuild-environment.h:250
friend environment operator-(environment const &lhs, T const &rhs)
Remove variables from the environment.
Definition: sbuild-environment.h:282
void add(std::string const &name, std::string const &value)
Add environment variable.
Definition: sbuild-environment.h:113
std::ostream & log_warning()
Log a warning message.
Definition: sbuild-log.cc:96