diff options
author | pixel <pixel> | 2007-09-24 07:50:43 +0000 |
---|---|---|
committer | pixel <pixel> | 2007-09-24 07:50:43 +0000 |
commit | 2952af5dfc96861f1fc1716668a7e6a22fd45b26 (patch) | |
tree | 647d9101cbdff0d4d9688c7729e5df00ef514286 | |
parent | b862c5ec77a0f8fe40bd6c12b65a7739bdec2b00 (diff) |
Adding begin/end iterators for config files.
-rw-r--r-- | include/ConfigFile.h | 6 | ||||
-rw-r--r-- | lib/ConfigFile.cc | 10 |
2 files changed, 14 insertions, 2 deletions
diff --git a/include/ConfigFile.h b/include/ConfigFile.h index 87d111f..7328ce9 100644 --- a/include/ConfigFile.h +++ b/include/ConfigFile.h @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* $Id: ConfigFile.h,v 1.6 2007-05-30 11:57:08 pixel Exp $ */ +/* $Id: ConfigFile.h,v 1.7 2007-09-24 07:50:43 pixel Exp $ */ #ifndef __CONFIGFILE_H__ #define __CONFIGFILE_H__ @@ -28,11 +28,15 @@ typedef std::map<String, String> ConfigSectionContents; typedef std::map<String, ConfigSectionContents> ConfigSection; +typedef std::map<String, String>::iterator ConfigSectionContentsIterator; +typedef std::map<String, ConfigSectionContents>::iterator ConfigSectionIterator; class ConfigFile : public Base { public: ConfigFile(Handle *) throw (GeneralException); ConfigSectionContents & operator[](String); + ConfigSectionIterator begin(); + ConfigSectionIterator end(); private: ConfigSection c; }; diff --git a/lib/ConfigFile.cc b/lib/ConfigFile.cc index bfb6a60..f71b79f 100644 --- a/lib/ConfigFile.cc +++ b/lib/ConfigFile.cc @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* $Id: ConfigFile.cc,v 1.5 2007-05-30 11:57:09 pixel Exp $ */ +/* $Id: ConfigFile.cc,v 1.6 2007-09-24 07:50:43 pixel Exp $ */ #include "ConfigFile.h" #include "BRegex.h" @@ -62,3 +62,11 @@ ConfigFile::ConfigFile(Handle * f) throw (GeneralException) { ConfigSectionContents & ConfigFile::operator[](String s) { return c[s]; } + +ConfigSectionIterator ConfigFile::begin() { + return c.begin(); +} + +ConfigSectionIterator ConfigFile::end() { + return c.end(); +} |