libzypp  11.13.5
ContentFileReader.h
Go to the documentation of this file.
1 /*---------------------------------------------------------------------\
2 | ____ _ __ __ ___ |
3 | |__ / \ / / . \ . \ |
4 | / / \ V /| _/ _/ |
5 | / /__ | | | | | | |
6 | /_____||_| |_| |_| |
7 | |
8 \---------------------------------------------------------------------*/
12 #ifndef ZYPP_PARSER_SUSETAGS_CONTENTFILEREADER_H
13 #define ZYPP_PARSER_SUSETAGS_CONTENTFILEREADER_H
14 
15 #include <iosfwd>
16 
17 #include "zypp/base/PtrTypes.h"
18 #include "zypp/base/NonCopyable.h"
19 #include "zypp/base/Function.h"
20 #include "zypp/base/InputStream.h"
21 
22 #include "zypp/ProgressData.h"
23 
25 namespace zypp
26 {
27 
29  namespace parser
30  {
31 
32  namespace susetags
33  {
34 
35  class RepoIndex;
36  DEFINE_PTR_TYPE(RepoIndex);
37 
39  //
40  // CLASS NAME : ContentFileReader
41  //
46  {
47  public:
48  typedef function<void(const RepoIndex_Ptr &)> RepoIndexConsumer;
49 
50  public:
54  virtual ~ContentFileReader();
61  virtual void parse( const InputStream & imput_r,
63 
64  public:
67  { _repoIndexConsumer = fnc_r; }
68 
69  protected:
71  virtual void beginParse();
73  virtual void endParse();
74 
75  protected:
79  virtual void userRequestedAbort( unsigned lineNo_r );
80 
81  protected:
83  std::string errPrefix( unsigned lineNo_r,
84  const std::string & msg_r = std::string(),
85  const std::string & line_r = "-" ) const;
86 
87  private:
88  class Impl;
91  };
93 
95  } // namespace susetags
98  } // namespace parser
101 } // namespace zypp
103 #endif // ZYPP_PARSER_SUSETAGS_CONTENTFILEREADER_H