| /_____||_| |_| |_| |
| |
\---------------------------------------------------------------------*/
-/** \file zypp/parser/yum/RepoindexFileReader.h
+/** \file zypp/parser/RepoindexFileReader.h
* Interface of repoindex.xml file reader.
*/
#ifndef zypp_source_yum_RepoindexFileReader_H
#include "zypp/base/PtrTypes.h"
#include "zypp/base/NonCopyable.h"
#include "zypp/base/Function.h"
-
-#include "zypp/RepoInfo.h"
+#include "zypp/base/InputStream.h"
+#include "zypp/Pathname.h"
+#include "zypp/Date.h"
namespace zypp
{
+ class RepoInfo;
+
namespace parser
{
*
* After each repository is read, a \ref RepoInfo
* is prepared and \ref _callback
- * is called with these two objects passed in.
+ * is called with this object passed in.
*
* The \ref _callback is provided on construction.
*
*
* \code
- * RepoindexFileReader reader(repoindex_file,
+ * RepoindexFileReader reader(repoindex_file,
* bind( &SomeClass::callbackfunc, &SomeClassInstance, _1) );
* \endcode
*/
/**
* Callback definition.
* First parameter is a \ref RepoInfo object with the resource
- * second parameter is the resource type.
+ * FIXME return value is ignored
*/
- typedef function< bool(
- const RepoInfo & )>
- ProcessResource;
+ typedef function< bool( const RepoInfo & )> ProcessResource;
/**
* CTOR. Creates also \ref xml::Reader and starts reading.
- *
- * \param repoindex_file is the repoindex.xml file you want to read
+ *
+ * \param repoindexFile is the repoindex.xml file you want to read
* \param callback is a function.
*
* \see RepoindexFileReader::ProcessResource
*/
- RepoindexFileReader(
- const Pathname & repoindex_file, const ProcessResource & callback);
+ RepoindexFileReader( const zypp::Pathname & repoindexFile,
+ const ProcessResource & callback);
+
+ /**
+ * \short Constructor. Creates the reader and start reading.
+ *
+ * \param is a valid input stream
+ * \param callback Callback that will be called for each repository.
+ *
+ * \see RepoindexFileReader::ProcessResource
+ */
+ RepoindexFileReader( const InputStream &is,
+ const ProcessResource & callback );
/**
* DTOR
*/
~RepoindexFileReader();
+ /** Metadata TTL (repoindex.xml:xpath:/repoindex@ttl or 0). */
+ Date::Duration ttl() const;
+
private:
class Impl;
RW_pointer<Impl,rw_pointer::Scoped<Impl> > _pimpl;