zypp::parser::RepoFileReader Class Reference

Read repository data from a .repo file. More...

#include <RepoFileReader.h>

List of all members.

Public Types

typedef function< bool(const
RepoInfo &)> 
ProcessRepo
 Callback definition.

Public Member Functions

 RepoFileReader (const Pathname &repo_file, const ProcessRepo &callback, const ProgressData::ReceiverFnc &progress=ProgressData::ReceiverFnc())
 Constructor.
 RepoFileReader (const InputStream &is, const ProcessRepo &callback, const ProgressData::ReceiverFnc &progress=ProgressData::ReceiverFnc())
 Constructor.
 ~RepoFileReader ()
 Dtor.

Private Attributes

ProcessRepo _callback

Friends

std::ostream & operator<< (std::ostream &str, const RepoFileReader &obj)


Detailed Description

Read repository data from a .repo file.

After each repo is read, a RepoInfo is prepared and _callback is called with the object passed in.

The _callback is provided on construction.

 RepoFileReader reader(repo_file, 
                bind( &SomeClass::callbackfunc, &SomeClassInstance, _1, _2 ) );

Definition at line 42 of file RepoFileReader.h.


Member Typedef Documentation

typedef function< bool( const RepoInfo & )> zypp::parser::RepoFileReader::ProcessRepo

Callback definition.

First parameter is a RepoInfo object with the resource second parameter is the resource type.

Return false from the callback to get a AbortRequestException to be thrown and the processing to be cancelled.

Definition at line 55 of file RepoFileReader.h.


Constructor & Destructor Documentation

zypp::parser::RepoFileReader::RepoFileReader ( const Pathname &  repo_file,
const ProcessRepo callback,
const ProgressData::ReceiverFnc progress = ProgressData::ReceiverFnc() 
)

Constructor.

Creates the reader and start reading.

Parameters:
repo_file A valid .repo file
callback Callback that will be called for each repository.
progress Optional progress function.
See also:
ProgressData
Exceptions:
AbortRequestException If the callback returns false
Exception If a error occurs at reading / parsing

Definition at line 109 of file RepoFileReader.cc.

References _callback, and zypp::parser::repositories_in_stream().

zypp::parser::RepoFileReader::RepoFileReader ( const InputStream is,
const ProcessRepo callback,
const ProgressData::ReceiverFnc progress = ProgressData::ReceiverFnc() 
)

Constructor.

Creates the reader and start reading.

Parameters:
is A valid input stream
callback Callback that will be called for each repository.
progress Optional progress function.
See also:
ProgressData
Exceptions:
AbortRequestException If the callback returns false
Exception If a error occurs at reading / parsing

Definition at line 117 of file RepoFileReader.cc.

References _callback, and zypp::parser::repositories_in_stream().

zypp::parser::RepoFileReader::~RepoFileReader (  ) 

Dtor.

Definition at line 125 of file RepoFileReader.cc.


Friends And Related Function Documentation

std::ostream & operator<< ( std::ostream &  str,
const RepoFileReader obj 
) [friend]

Stream output

Definition at line 129 of file RepoFileReader.cc.


Member Data Documentation

Definition at line 96 of file RepoFileReader.h.

Referenced by RepoFileReader().


The documentation for this class was generated from the following files:

doxygen