libzypp 17.31.23
|
Read repository data from a .repo file. More...
#include <parser/RepoFileReader.h>
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) |
Related Functions | |
(Note that these are not member functions.) | |
std::ostream & | operator<< (std::ostream &str, const RepoFileReader &obj) |
Stream output. | |
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.
baseurl=
tag on each line is also accepted, but when the file has to be written, the preferred style is used. Definition at line 51 of file RepoFileReader.h.
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 64 of file RepoFileReader.h.
zypp::parser::RepoFileReader::RepoFileReader | ( | const Pathname & | repo_file, |
const ProcessRepo & | callback, | ||
const ProgressData::ReceiverFnc & | progress = ProgressData::ReceiverFnc() |
||
) |
Constructor.
Creates the reader and start reading.
repo_file | A valid .repo file |
callback | Callback that will be called for each repository. |
progress | Optional progress function. |
AbortRequestException | If the callback returns false |
Exception | If a error occurs at reading / parsing |
Definition at line 231 of file RepoFileReader.cc.
zypp::parser::RepoFileReader::RepoFileReader | ( | const InputStream & | is, |
const ProcessRepo & | callback, | ||
const ProgressData::ReceiverFnc & | progress = ProgressData::ReceiverFnc() |
||
) |
Constructor.
Creates the reader and start reading.
is | A valid input stream |
callback | Callback that will be called for each repository. |
progress | Optional progress function. |
AbortRequestException | If the callback returns false |
Exception | If a error occurs at reading / parsing |
Definition at line 239 of file RepoFileReader.cc.
zypp::parser::RepoFileReader::~RepoFileReader | ( | ) |
Dtor.
Definition at line 247 of file RepoFileReader.cc.
|
friend |
Definition at line 251 of file RepoFileReader.cc.
|
related |
Stream output.
Definition at line 251 of file RepoFileReader.cc.
|
private |
Definition at line 105 of file RepoFileReader.h.