X-Git-Url: http://git.home-dn.net/?p=manu%2Fsuphp.git;a=blobdiff_plain;f=src%2FIniSection.hpp;h=42f59f1a66c9e199877fc9ba426fa2dbc20f84ff;hp=1e768ca7f79f5319bae0ce5a9f5eae2376a8c874;hb=849f4a7977b5780eacae8fad7a078d05f4a615ee;hpb=b0eaa3f1fbf491fdc8a3044cf20754f14254338a diff --git a/src/IniSection.hpp b/src/IniSection.hpp index 1e768ca..42f59f1 100644 --- a/src/IniSection.hpp +++ b/src/IniSection.hpp @@ -1,5 +1,5 @@ -#/* - suPHP - (c)2002-2005 Sebastian Marsching +/* + suPHP - (c)2002-2008 Sebastian Marsching This file is part of suPHP. @@ -40,37 +40,38 @@ namespace suPHP { */ class IniSection { private: - std::multimap entries; - void putValue(std::string key, std::string value); + std::multimap entries; + void putValue(const std::string key, const std::string value); + void removeValues(const std::string& key); public: - /** - * Returns values corresponding to key - */ - std::vector getValues(std::string key) - throw (KeyNotFoundException); + /** + * Returns values corresponding to key + */ + const std::vector getValues(const std::string& key) const + throw (KeyNotFoundException); - /** - * Returns first value corresponding to a key - */ - std::string getValue(std::string key) throw (KeyNotFoundException); + /** + * Returns first value corresponding to a key + */ + std::string getValue(const std::string& key) const throw (KeyNotFoundException); - /** - * Returns keys appearing in this section - */ - std::vector getKeys(); - /** - * Overloaded index operator, calls getValues() - */ - std::vector operator[](std::string key) - throw (KeyNotFoundException); + /** + * Returns keys appearing in this section + */ + const std::vector getKeys() const; + /** + * Overloaded index operator, calls getValues() + */ + const std::vector operator[](const std::string& key) const + throw (KeyNotFoundException); - friend class IniFile; - - /** - * Check wheter key is existing within section - */ - bool hasKey(std::string name); + friend class IniFile; + + /** + * Check wheter key is existing within section + */ + bool hasKey(const std::string& name) const; }; };