X-Git-Url: http://git.home-dn.net/?p=manu%2Fsuphp.git;a=blobdiff_plain;f=src%2FEnvironment.cpp;h=14362e86592d9c2acb584d4c12c1c194fc9145ac;hp=857e84e1c45fd0953b45d9d8e3dd1e823e315b06;hb=849f4a7977b5780eacae8fad7a078d05f4a615ee;hpb=b0eaa3f1fbf491fdc8a3044cf20754f14254338a diff --git a/src/Environment.cpp b/src/Environment.cpp index 857e84e..14362e8 100644 --- a/src/Environment.cpp +++ b/src/Environment.cpp @@ -30,33 +30,33 @@ using namespace suPHP; std::string suPHP::Environment::getVar(const std::string& name) const throw (KeyNotFoundException) { if (this->vars.find(name) != this->vars.end()) { - return this->vars.find(name)->second; + return this->vars.find(name)->second; } else { - throw KeyNotFoundException("Key " + name + " not found", - __FILE__, __LINE__); + throw KeyNotFoundException("Key " + name + " not found", + __FILE__, __LINE__); } } void suPHP::Environment::setVar(const std::string name, - const std::string content) + const std::string content) throw (KeyNotFoundException) { if (this->vars.find(name) != this->vars.end()) { - this->vars.find(name)->second = content; + this->vars.find(name)->second = content; } else { - throw KeyNotFoundException("Key " + name + " not found", - __FILE__, __LINE__); + throw KeyNotFoundException("Key " + name + " not found", + __FILE__, __LINE__); } } void suPHP::Environment::putVar(const std::string name, - const std::string content) { + const std::string content) { if (this->vars.find(name) != this->vars.end()) { - this->vars.find(name)->second = content; + this->vars.find(name)->second = content; } else { - std::pair p; - p.first = name; - p.second = content; - this->vars.insert(p); + std::pair p; + p.first = name; + p.second = content; + this->vars.insert(p); } } @@ -64,18 +64,18 @@ void suPHP::Environment::putVar(const std::string name, void suPHP::Environment::deleteVar(const std::string& name) throw (KeyNotFoundException) { if (this->vars.find(name) != this->vars.end()) { - this->vars.erase(name); + this->vars.erase(name); } else { - throw KeyNotFoundException("Key " + name + " not found", + throw KeyNotFoundException("Key " + name + " not found", __FILE__, __LINE__); } } bool suPHP::Environment::hasVar(const std::string& name) const { if (this->vars.find(name) != this->vars.end()) { - return true; + return true; } else { - return false; + return false; } } @@ -83,10 +83,10 @@ bool suPHP::Environment::hasVar(const std::string& name) const { std::string& suPHP::Environment::operator[](const std::string& name) throw (KeyNotFoundException) { if (this->vars.find(name) != this->vars.end()) { - return this->vars.find(name)->second; + return this->vars.find(name)->second; } else { - throw KeyNotFoundException("Key " + name + " not found", - __FILE__, __LINE__); + throw KeyNotFoundException("Key " + name + " not found", + __FILE__, __LINE__); } }