28 #define environ _environ
29 _CRTIMP
extern char ** _environ;
71 const char* estr = g_getenv (
_envname.c_str());
81 split (estr, lines,
'\n');
83 for (vector<string>::iterator i = lines.begin(); i != lines.end(); ++i) {
86 string::size_type equal = estring.find_first_of (
'=');
88 if (equal == string::npos) {
93 string before = estring.substr (0, equal);
94 string after = estring.substr (equal+1);
96 e.insert (pair<string,string>(before,after));
104 for (
size_t i = 0;
environ[i]; ++i) {
107 string::size_type equal = estring.find_first_of (
'=');
109 if (equal == string::npos) {
114 string before = estring.substr (0, equal);
115 string after = estring.substr (equal+1);
117 e.insert (pair<string,string>(before,after));
126 for (map<string,string>::const_iterator i =
e.begin(); i !=
e.end(); ++i) {
127 g_setenv (i->first.c_str(), i->second.c_str(), 1);
139 vector<string> ecopy;
141 for (
size_t i = 0;
environ[i]; ++i) {
145 for (vector<string>::const_iterator
e = ecopy.begin();
e != ecopy.end(); ++
e) {
146 string::size_type equal = (*e).find_first_of (
'=');
148 if (equal == string::npos) {
153 string var_name = (*e).substr (0, equal);
154 g_unsetenv(var_name.c_str());
LIBPBD_API void split(std::string, std::vector< std::string > &, char)
EnvironmentalProtectionAgency(bool arm=true, const std::string &envname=std::string())
std::map< std::string, std::string > e
static EnvironmentalProtectionAgency * _global_epa
~EnvironmentalProtectionAgency()