1 /*---------------------------------------------------------------------\
3 | |__ / \ / / . \ . \ |
8 \---------------------------------------------------------------------*/
9 /** \file zypp/parser/IniParser.h
12 #ifndef ZYPP_PARSER_INIPARSER_H
13 #define ZYPP_PARSER_INIPARSER_H
19 #include "zypp/base/PtrTypes.h"
20 #include "zypp/base/NonCopyable.h"
21 #include "zypp/base/InputStream.h"
23 #include "zypp/parser/tagfile/ParseException.h"
25 ///////////////////////////////////////////////////////////////////
27 { /////////////////////////////////////////////////////////////////
28 ///////////////////////////////////////////////////////////////////
30 { /////////////////////////////////////////////////////////////////
32 using tagfile::ParseException;
34 ///////////////////////////////////////////////////////////////////
36 // CLASS NAME : IniParser
38 /** Basic SUSEtags parser.
39 * Will replace parser/tagfile/ and parser/taggedfile/ stuff.
41 class IniParser : private base::NonCopyable
49 * \throw ParseExcetion on errors. Invoke \ref consume
50 * for each tag. \ref consume might throw other exceptions
53 void parse( const InputStream & imput_r );
56 /** Called when start parsing. */
57 virtual void beginParse();
58 /** Called when a section is found. */
59 virtual void consume( const std::string §ion );
60 /** Called when a key value is found. */
61 virtual void consume( const std::string §ion, const std::string &key, const std::string &value );
62 /** Called when the parse is done. */
63 virtual void endParse();
65 /** Name of the current InputStream. */
66 const std::string & inputname() const
72 std::string _inputname;
73 std::string _current_section;
75 //ProgressData _ticks;
78 /////////////////////////////////////////////////////////////////
80 ///////////////////////////////////////////////////////////////////
81 /////////////////////////////////////////////////////////////////
83 ///////////////////////////////////////////////////////////////////
84 #endif // ZYPP_PARSER_INIPARSER_H