00001 /*---------------------------------------------------------------------\ 00002 | ____ _ __ __ ___ | 00003 | |__ / \ / / . \ . \ | 00004 | / / \ V /| _/ _/ | 00005 | / /__ | | | | | | | 00006 | /_____||_| |_| |_| | 00007 | | 00008 \---------------------------------------------------------------------*/ 00012 #ifndef ZYPP_PARSER_INIPARSER_H 00013 #define ZYPP_PARSER_INIPARSER_H 00014 00015 #include <iosfwd> 00016 #include <string> 00017 #include <list> 00018 00019 #include "zypp/base/PtrTypes.h" 00020 #include "zypp/base/NonCopyable.h" 00021 #include "zypp/base/InputStream.h" 00022 00024 namespace zypp 00025 { 00026 00027 namespace parser 00028 { 00029 00031 // 00032 // CLASS NAME : IniParser 00033 // 00037 class IniParser : private base::NonCopyable 00038 { 00039 public: 00041 IniParser(); 00043 virtual ~IniParser(); 00049 void parse( const InputStream & imput_r ); 00050 00051 public: 00053 virtual void beginParse(); 00055 virtual void consume( const std::string §ion ); 00057 virtual void consume( const std::string §ion, const std::string &key, const std::string &value ); 00059 virtual void endParse(); 00060 public: 00062 const std::string & inputname() const 00063 { 00064 return _inputname; 00065 } 00066 00067 private: 00068 std::string _inputname; 00069 std::string _current_section; 00070 int _line_nr; 00071 }; 00072 00074 } // namespace parser 00077 } // namespace zypp 00079 #endif // ZYPP_PARSER_INIPARSER_H
1.4.6