libzypp 9.41.1

RepoFileReader.h

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------\
00002 |                          ____ _   __ __ ___                          |
00003 |                         |__  / \ / / . \ . \                         |
00004 |                           / / \ V /|  _/  _/                         |
00005 |                          / /__ | | | | | |                           |
00006 |                         /_____||_| |_| |_|                           |
00007 |                                                                      |
00008 \---------------------------------------------------------------------*/
00012 #ifndef ZYPP_REPO_REPOFILEREADER_H
00013 #define ZYPP_REPO_REPOFILEREADER_H
00014 
00015 #include <iosfwd>
00016 
00017 #include "zypp/base/PtrTypes.h"
00018 #include "zypp/base/InputStream.h"
00019 #include "zypp/RepoInfo.h"
00020 #include "zypp/ProgressData.h"
00021 
00023 namespace zypp
00024 { 
00025 
00026   namespace parser
00027   { 
00028 
00051     class RepoFileReader
00052     {
00053       friend std::ostream & operator<<( std::ostream & str, const RepoFileReader & obj );
00054     public:
00055 
00064       typedef function< bool( const RepoInfo & )> ProcessRepo;
00065 
00067       class Impl;
00068 
00069     public:
00081       RepoFileReader( const Pathname & repo_file,
00082                       const ProcessRepo & callback,
00083                       const ProgressData::ReceiverFnc &progress = ProgressData::ReceiverFnc() );
00084 
00096       RepoFileReader( const InputStream &is,
00097                       const ProcessRepo & callback,
00098                       const ProgressData::ReceiverFnc &progress = ProgressData::ReceiverFnc() );
00099 
00103       ~RepoFileReader();
00104     private:
00105       ProcessRepo _callback;
00106     };
00108 
00110     std::ostream & operator<<( std::ostream & str, const RepoFileReader & obj );
00111 
00113   } // namespace parser
00116 } // namespace zypp
00118 #endif // ZYPP_REPO_REPOFILEREADER_H