1 /*---------------------------------------------------------------------\
3 | |__ / \ / / . \ . \ |
8 \---------------------------------------------------------------------*/
9 /** \file zypp/parser/yum/RepomdFileReader.h
10 * Interface of repomd.xml file reader.
12 #ifndef zypp_source_yum_RepomdFileReader_H
13 #define zypp_source_yum_RepomdFileReader_H
15 #include "zypp/base/PtrTypes.h"
16 #include "zypp/base/NonCopyable.h"
17 #include "zypp/base/Function.h"
19 #include "zypp/OnMediaLocation.h"
20 #include "zypp/repo/yum/ResourceType.h"
31 * Reads through a repomd.xml file and collects type, location, checksum and
32 * other data about metadata files to be processed.
34 * After each package is read, a \ref OnMediaLocation
35 * and \ref repo::yum::ResourceType is prepared and \ref _callback
36 * is called with these two objects passed in.
38 * The \ref _callback is provided on construction.
42 * RepomdFileReader reader(repomd_file,
43 * bind( &SomeClass::callbackfunc, &SomeClassInstance, _1, _2 ) );
46 class RepomdFileReader : private base::NonCopyable
50 * Callback definition.
51 * First parameter is a \ref OnMediaLocation object with the resource
52 * second parameter is the resource type.
54 typedef function< bool(
55 const OnMediaLocation &,
56 const repo::yum::ResourceType &)>
60 * CTOR. Creates also \ref xml::Reader and starts reading.
62 * \param repomd_file is the repomd.xml file you want to read
63 * \param callback is a function.
65 * \see RepomdFileReader::ProcessResource
68 const Pathname & repomd_file, const ProcessResource & callback);
77 RW_pointer<Impl,rw_pointer::Scoped<Impl> > _pimpl;
85 #endif /*zypp_source_yum_RepomdFileReader_H*/
87 // vim: set ts=2 sts=2 sw=2 et ai: