34 T
get(
const char* name,
const T& defaultValue)
37 throw std::runtime_error(
"[env::get()] null variable name");
39 T
value(defaultValue);
40 char* result = ::getenv(name);
48 T
get(
const std::string& name,
const T& defaultValue)
51 throw std::runtime_error(
"[env::get()] empty variable name");
53 return get(name.c_str(), defaultValue);
58 inline std::string
get(
const std::string& name) {
return get<std::string>(name, std::string());}
float lexical_cast(const std::string &str)
PWIZ_API_DECL std::string value(const std::string &id, const std::string &name)
convenience function to extract a named value from an id string