// Feeping Creaturism // // Douglas Thrift // // $Id$ #include "Environment.hpp" std::string Environment::get(const std::string& name) const { char* value(getenv(name.c_str())); return value != NULL ? value : ""; } int Environment::set(const std::string& name, const std::string& value, bool overwrite) { return setenv(name.c_str(), value.c_str(), overwrite); } int Environment::put(const std::string& env) { std::istringstream input(env); std::string name, value; std::getline(input, name, '='); std::getline(input, value); return set(name, value); } Environment env;