libzypp  10.5.0
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 
00042     class RepoFileReader
00043     {
00044       friend std::ostream & operator<<( std::ostream & str, const RepoFileReader & obj );
00045     public:
00046       
00055       typedef function< bool( const RepoInfo & )> ProcessRepo;
00056       
00058       class Impl;
00059 
00060     public:
00072       RepoFileReader( const Pathname & repo_file,
00073                       const ProcessRepo & callback,
00074                       const ProgressData::ReceiverFnc &progress = ProgressData::ReceiverFnc() );
00075 
00087       RepoFileReader( const InputStream &is,
00088                       const ProcessRepo & callback,
00089                       const ProgressData::ReceiverFnc &progress = ProgressData::ReceiverFnc() );
00090      
00094       ~RepoFileReader();
00095     private:
00096       ProcessRepo _callback;
00097     };
00099 
00101     std::ostream & operator<<( std::ostream & str, const RepoFileReader & obj );
00102 
00104   } // namespace parser
00107 } // namespace zypp
00109 #endif // ZYPP_REPO_REPOFILEREADER_H