19 #ifndef SBUILD_ENVIRONMENT_H
20 #define SBUILD_ENVIRONMENT_H
22 #include <sbuild/log.h>
23 #include <sbuild/parse-value.h>
24 #include <sbuild/regex.h>
30 #include <boost/format.hpp>
41 using std::map<std::string, std::string>::value_type;
85 add (
char **environment);
94 add (
const environment& environment);
103 add (
const value_type& value);
113 add (
const std::string& name,
114 const std::string& value)
116 add(std::make_pair(name, value));
128 add (
const std::string& 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 (
const std::string& value);
173 remove (
const std::string& value);
182 remove (
const value_type& value);
192 template <
typename T>
194 get (
const std::string& 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 const environment& rhs)
303 for (
const auto& env : rhs)
305 stream << env.first <<
'=' << env.second <<
'\n';