#include "zypp/base/Function.h"
#include "zypp/OnMediaLocation.h"
-#include "zypp/source/yum/YUMResourceType.h"
namespace zypp
{
* Reads through a repomd.xml file and collects type, location, checksum and
* other data about metadata files to be processed.
*
- * After each package is read, a \ref OnMediaLocation
- * and \ref source::yum::YUMResourceType is prepared and \ref _callback
- * is called with these two objects passed in.
- *
- * The \ref _callback is provided on construction.
- *
- *
- * \code
- * RepomdFileReader reader(repomd_file,
- * bind( &SomeClass::callbackfunc, &SomeClassInstance, _1, _2 ) );
- * \endcode
+ * After each file entry is read, an \ref OnMediaLocation and the resource type
+ * string are prepared and passed to the \ref _callback.
*/
- class RepomdFileReader
+ class RepomdFileReader : private base::NonCopyable
{
public:
- /**
- * Callback definition.
- * First parameter is a \ref OnMediaLocation object with the resource
- * second parameter is the resource type.
- */
- typedef function< bool(
- const OnMediaLocation &,
- const source::yum::YUMResourceType &)>
- ProcessResource;
+ /** Callback taking \ref OnMediaLocation and the resource type string */
+ typedef function< bool( OnMediaLocation &&, const std::string & )> ProcessResource;
/**
* CTOR. Creates also \ref xml::Reader and starts reading.
*
* \see RepomdFileReader::ProcessResource
*/
- RepomdFileReader(
- const Pathname & repomd_file, const ProcessResource & callback);
-
- /**
- * DTOR
- */
+ RepomdFileReader( const Pathname & repomd_file, const ProcessResource & callback );
+
+ /** DTOR */
~RepomdFileReader();
private:
};
- }
- }
-}
-
-#endif
-
+ } // namespace yum
+ } // namespace parser
+} // namespace zypp
+#endif // zypp_source_yum_RepomdFileReader_H