1 /*---------------------------------------------------------------------\
3 | |__ / \ / / . \ . \ |
8 \---------------------------------------------------------------------*/
9 /** \file zypp/parser/RepoindexFileReader.h
10 * Interface of repoindex.xml file reader.
12 #ifndef zypp_source_yum_RepoindexFileReader_H
13 #define zypp_source_yum_RepoindexFileReader_H
15 #include "zypp/base/PtrTypes.h"
16 #include "zypp/base/NonCopyable.h"
17 #include "zypp/base/Function.h"
18 #include "zypp/base/InputStream.h"
19 #include "zypp/Pathname.h"
29 * Reads through a repoindex.xml file and collects repositories.
31 * After each repository is read, a \ref RepoInfo
32 * is prepared and \ref _callback
33 * is called with this object passed in.
35 * The \ref _callback is provided on construction.
39 * RepoindexFileReader reader(repoindex_file,
40 * bind( &SomeClass::callbackfunc, &SomeClassInstance, _1) );
43 class RepoindexFileReader : private base::NonCopyable
47 * Callback definition.
48 * First parameter is a \ref RepoInfo object with the resource
49 * FIXME return value is ignored
51 typedef function< bool(
56 * CTOR. Creates also \ref xml::Reader and starts reading.
58 * \param repoindexFile is the repoindex.xml file you want to read
59 * \param callback is a function.
61 * \see RepoindexFileReader::ProcessResource
63 RepoindexFileReader( const zypp::Pathname & repoindexFile,
64 const ProcessResource & callback);
67 * \short Constructor. Creates the reader and start reading.
69 * \param is a valid input stream
70 * \param callback Callback that will be called for each repository.
72 * \see RepoindexFileReader::ProcessResource
74 RepoindexFileReader( const InputStream &is,
75 const ProcessResource & callback );
80 ~RepoindexFileReader();
84 RW_pointer<Impl,rw_pointer::Scoped<Impl> > _pimpl;
91 #endif /*zypp_source_yum_RepoindexFileReader_H*/
93 // vim: set ts=2 sts=2 sw=2 et ai: