1 /*---------------------------------------------------------------------\
3 | |__ / \ / / . \ . \ |
8 \---------------------------------------------------------------------*/
9 /** \file zypp/parser/yum/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"
19 #include "zypp/RepoInfo.h"
27 * Reads through a repoindex.xml file and collects repositories.
29 * After each repository is read, a \ref RepoInfo
30 * is prepared and \ref _callback
31 * is called with these two objects passed in.
33 * The \ref _callback is provided on construction.
37 * RepoindexFileReader reader(repoindex_file,
38 * bind( &SomeClass::callbackfunc, &SomeClassInstance, _1) );
41 class RepoindexFileReader : private base::NonCopyable
45 * Callback definition.
46 * First parameter is a \ref RepoInfo object with the resource
47 * second parameter is the resource type.
49 typedef function< bool(
54 * CTOR. Creates also \ref xml::Reader and starts reading.
56 * \param repoindex_file is the repoindex.xml file you want to read
57 * \param callback is a function.
59 * \see RepoindexFileReader::ProcessResource
62 const Pathname & repoindex_file, const ProcessResource & callback);
67 ~RepoindexFileReader();
71 RW_pointer<Impl,rw_pointer::Scoped<Impl> > _pimpl;
78 #endif /*zypp_source_yum_RepoindexFileReader_H*/
80 // vim: set ts=2 sts=2 sw=2 et ai: