libzypp 17.31.23
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-core/base/InputStream>
21
22#include <zypp-core/ui/ProgressData>
23
25namespace zypp
26{
27
29 namespace parser
30 {
32 namespace susetags
33 {
34
35 class 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 struct Impl;
91 };
93
95 } // namespace susetags
98 } // namespace parser
101} // namespace zypp
103#endif // ZYPP_PARSER_SUSETAGS_CONTENTFILEREADER_H
RepoManager implementation.
Helper to create and pass std::istream.
Definition: inputstream.h:57
function< bool(const ProgressData &)> ReceiverFnc
Most simple version of progress reporting The percentage in most cases.
Definition: progressdata.h:140
Parse repoindex part from a content file.
virtual void userRequestedAbort(unsigned lineNo_r)
Called when user(callback) request to abort.
virtual void parse(const InputStream &imput_r, const ProgressData::ReceiverFnc &fnc_r=ProgressData::ReceiverFnc())
Parse the stream.
void setRepoIndexConsumer(const RepoIndexConsumer &fnc_r)
Consumer to call when repo index was parsed.
virtual void endParse()
Called when the parse is done.
std::string errPrefix(unsigned lineNo_r, const std::string &msg_r=std::string(), const std::string &line_r="-") const
Prefix exception message with line information.
RW_pointer< Impl, rw_pointer::Scoped< Impl > > _pimpl
function< void(const RepoIndex_Ptr &)> RepoIndexConsumer
virtual void beginParse()
Called when start parsing.
Repository content data (from /content file).
Definition: RepoIndex.h:49
boost::noncopyable NonCopyable
Ensure derived classes cannot be copied.
Definition: NonCopyable.h:26
Easy-to use interface to the ZYPP dependency resolver.
Definition: CodePitfalls.doc:2
Wrapper for const correct access via Smart pointer types.
Definition: PtrTypes.h:286
#define DEFINE_PTR_TYPE(NAME)
Forward declaration of Ptr types.
Definition: PtrTypes.h:623