/*
- suPHP - (c)2002-2005 Sebastian Marsching <sebastian@marsching.com>
+ suPHP - (c)2002-2008 Sebastian Marsching <sebastian@marsching.com>
This file is part of suPHP.
*/
class IniFile {
private:
- std::map<std::string, IniSection> sections;
+ std::map<std::string, IniSection> sections;
+
+ std::string parseValue(const std::string& value) const throw (ParsingException);
public:
- /**
- * Reads values from INI file
- */
- void parse(File file) throw (IOException, ParsingException);
+ /**
+ * Reads values from INI file
+ */
+ void parse(const File& file) throw (IOException, ParsingException);
- /**
- * Returns section
- */
- IniSection& getSection(std::string name) throw (KeyNotFoundException);
-
- /**
- * Index operator
- */
- IniSection& operator[](std::string name) throw (KeyNotFoundException);
+ /**
+ * Returns section
+ */
+ const IniSection& getSection(const std::string& name) const throw (KeyNotFoundException);
+
+ /**
+ * Index operator
+ */
+ const IniSection& operator[](const std::string& name) const throw (KeyNotFoundException);
- /**
- * Returns vector containing names of all sections
- */
- std::vector<std::string> getSections();
+ /**
+ * Returns vector containing names of all sections
+ */
+ const std::vector<const std::string> getSections();
- /**
- * Checks wheter a section is existing
- */
- bool hasSection(std::string name);
+ /**
+ * Checks wheter a section is existing
+ */
+ bool hasSection(const std::string& name) const;
};
};