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"
22
#include "zypp/ProgressData.h"
24
///////////////////////////////////////////////////////////////////
26
{ /////////////////////////////////////////////////////////////////
27
///////////////////////////////////////////////////////////////////
29
{ /////////////////////////////////////////////////////////////////
31
///////////////////////////////////////////////////////////////////
33
// CLASS NAME : IniParser
35
/** Basic SUSEtags parser.
36
* Will replace parser/tagfile/ and parser/taggedfile/ stuff.
38
class IniParser : private base::NonCopyable
46
* \throw ParseException on errors. Invoke \ref consume
47
* for each tag. \ref consume might throw other exceptions
50
void parse( const InputStream & imput_r, const ProgressData::ReceiverFnc & progress = ProgressData::ReceiverFnc() );
53
/** Called when start parsing. */
54
virtual void beginParse();
55
/** Called when a section is found. */
56
virtual void consume( const std::string §ion );
57
/** Called when a key value is found. */
58
virtual void consume( const std::string §ion, const std::string &key, const std::string &value );
59
/** Called when the parse is done. */
60
virtual void endParse();
62
/** Name of the current InputStream. */
63
const std::string & inputname() const
69
std::string _inputname;
70
std::string _current_section;
72
//ProgressData _ticks;
75
/////////////////////////////////////////////////////////////////
77
///////////////////////////////////////////////////////////////////
78
/////////////////////////////////////////////////////////////////
80
///////////////////////////////////////////////////////////////////
81
#endif // ZYPP_PARSER_INIPARSER_H