20 Jan
2006
20 Jan
'06
12:36 a.m.
On 1/19/06, Merrill Cornish
Is there a Boost way to get environment variables? I _thought_ I had seen a reference to that in the program options libarary, but I can't find it now.
Merrill
How about: std::string get_env(std::string const& name) { char* var = getenv(name.c_str()); //getenv can return NULL, std::string(NULL) throws if(var) return var; else return ""; }