ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/repos/FeepingCreaturism/Environment.cpp
Revision: 194
Committed: 2004-08-27T01:21:18-07:00 (20 years, 9 months ago) by Douglas Thrift
File size: 586 byte(s)
Log Message:
Worky, worky!

File Contents

# Content
1 // Feeping Creaturism
2 //
3 // Douglas Thrift
4 //
5 // $Id$
6
7 #include "Environment.hpp"
8
9 std::string Environment::get(const std::string& name) const
10 {
11 char* value(getenv(name.c_str()));
12
13 return value != NULL ? value : "";
14 }
15
16 int Environment::set(const std::string& name, const std::string& value,
17 bool overwrite)
18 {
19 return setenv(name.c_str(), value.c_str(), overwrite);
20 }
21
22 int Environment::put(const std::string& env)
23 {
24 std::istringstream input(env);
25 std::string name, value;
26
27 std::getline(input, name, '=');
28 std::getline(input, value);
29
30 return set(name, value);
31 }
32
33 Environment env;

Properties

Name Value
svn:eol-style native
svn:keywords Id