X-Git-Url: https://git.teslayout.com/public/public/public/?p=anna.git;a=blobdiff_plain;f=source%2Fcore%2Futil%2FEnvironment.cpp;h=7ab71e29c5756c6d7d4ea45b823bf828b09ddaf8;hp=63d16269481ad5503a235b313230999e67fc6154;hb=5a6cba5fde2b2f538a7515f8293cc0a8d9589dfa;hpb=af9c86ffb0e28d35ad94d99c5f77e41578c972b4 diff --git a/source/core/util/Environment.cpp b/source/core/util/Environment.cpp index 63d1626..7ab71e2 100644 --- a/source/core/util/Environment.cpp +++ b/source/core/util/Environment.cpp @@ -23,7 +23,7 @@ using namespace anna; extern int errno; -void Environment::initialize(char **envp) throw() { +void Environment::initialize(char **envp) { LOGMETHOD(TraceMethod tm("Environment", "initialize", ANNA_FILE_LOCATION)); // clear data a_vars.clear(); @@ -47,7 +47,7 @@ void Environment::initialize(char **envp) throw() { } } -std::string Environment::getValue(const char* variableName, bool exceptionIfMissing) throw(RuntimeException) { +std::string Environment::getValue(const char* variableName, bool exceptionIfMissing) noexcept(false) { if(!variableName) throw RuntimeException("Invalid NULL variable name!", ANNA_FILE_LOCATION); @@ -55,7 +55,7 @@ std::string Environment::getValue(const char* variableName, bool exceptionIfMiss return getValue(var, exceptionIfMissing); } -std::string Environment::getValue(const std::string &variableName, bool exceptionIfMissing) throw(RuntimeException) { +std::string Environment::getValue(const std::string &variableName, bool exceptionIfMissing) noexcept(false) { std::string result = ""; std::map::const_iterator it = a_vars.find(variableName); @@ -82,7 +82,7 @@ std::string Environment::getValue(const std::string &variableName, bool exceptio } -void Environment::setVariable(const std::string &name, const std::string &value, bool overwrite) throw(RuntimeException) { +void Environment::setVariable(const std::string &name, const std::string &value, bool overwrite) noexcept(false) { if(name == "") throw RuntimeException("Must provide non-empty variable name", ANNA_FILE_LOCATION); if(setenv(name.c_str(), value.c_str(), overwrite ? 1 : 0) != 0) { @@ -101,7 +101,7 @@ void Environment::setVariable(const std::string &name, const std::string &value, } -void Environment::unsetVariable(const std::string &name) throw(RuntimeException) { +void Environment::unsetVariable(const std::string &name) noexcept(false) { if(name == "") throw RuntimeException("Must provide non-empty variable name", ANNA_FILE_LOCATION); if(unsetenv(name.c_str()) != 0) {