Slice Tools libFoundation |
ConfigFile.hhGo to the documentation of this file.00001 // $Id: ConfigFile.hh,v 1.1 2005/07/29 02:55:15 mschatz Exp $ 00002 00005 00006 #ifndef CONFIGFILE_HH 00007 #define CONFIGFILE_HH 1 00008 00009 #include <iostream> 00010 #include <fstream> 00011 #include <cstdio> // for sprintf 00012 00013 #include "ConfigSection.hh" 00014 #include "Exceptions.hh" 00015 00017 00020 class ConfigFile 00021 { 00022 public: 00023 ConfigFile(const std::string & filename); 00024 ~ConfigFile(); 00025 00026 void printConfiguration(); 00027 00028 ConfigSection * findSection(std::string sectionName); 00029 ConfigSection * getRootSection(); 00030 00031 private: 00032 void parseConfig(); 00033 00034 ConfigSection * m_rootSection; 00035 00036 std::string m_filename; 00037 std::ifstream m_configFile; 00038 00039 int m_linenum; 00040 }; 00041 00042 #endif |