|
libzypp
9.1.2
|
Parser for /etc/products.d enries (just relevant entires). More...
#include <ProductFileReader.h>
Public Types | |
| typedef function< bool(const ProductFileData &)> | Consumer |
| Callback being invoked for each ProductFileData parsed. | |
Public Member Functions | |
| ProductFileReader () | |
| ProductFileReader (const Consumer &consumer_r) | |
| ProductFileReader (const Consumer &consumer_r, const InputStream &input_r) | |
| const Consumer & | consumer () const |
| void | setConsumer (const Consumer &consumer_r) |
| bool | parse (const InputStream &input_r=InputStream()) const |
Parse the input stream and call _consumer for each parsed section. | |
Static Public Member Functions | |
| static bool | scanDir (const Consumer &consumer_r, const Pathname &dir_r) |
Parse all files (no symlinks) in dir_r and call consumer_r for each ProductFileData parsed. | |
| static ProductFileData | scanFile (const Pathname &file_r) |
| Parse one file (or symlink) and return the ProductFileData parsed. | |
Private Attributes | |
| Consumer | _consumer |
Parser for /etc/products.d enries (just relevant entires).
#include "zypp/base/Functional.h" // functor::getAll std::vector<ProductFileData> result; ProductFileReader::scanDir( functor::getAll( std::back_inserter( result ) ), "/etc/products.d" );
Definition at line 119 of file ProductFileReader.h.
| typedef function<bool( const ProductFileData & )> zypp::parser::ProductFileReader::Consumer |
Callback being invoked for each ProductFileData parsed.
Return false to stop parsing.
Definition at line 125 of file ProductFileReader.h.
| zypp::parser::ProductFileReader::ProductFileReader | ( | ) | [inline] |
Definition at line 128 of file ProductFileReader.h.
| zypp::parser::ProductFileReader::ProductFileReader | ( | const Consumer & | consumer_r | ) | [inline] |
Definition at line 131 of file ProductFileReader.h.
| zypp::parser::ProductFileReader::ProductFileReader | ( | const Consumer & | consumer_r, |
| const InputStream & | input_r | ||
| ) | [inline] |
Definition at line 135 of file ProductFileReader.h.
References parse().
| const Consumer& zypp::parser::ProductFileReader::consumer | ( | ) | const [inline] |
Definition at line 140 of file ProductFileReader.h.
References _consumer.
| void zypp::parser::ProductFileReader::setConsumer | ( | const Consumer & | consumer_r | ) | [inline] |
Definition at line 143 of file ProductFileReader.h.
References _consumer.
| bool zypp::parser::ProductFileReader::parse | ( | const InputStream & | input_r = InputStream() | ) | const |
Parse the input stream and call _consumer for each parsed section.
Returns false if the _consumer requested to stop parsing.
Definition at line 214 of file ProductFileReader.cc.
References _consumer, ERR, MIL, and zypp::xml::ParseDef::take().
Referenced by ProductFileReader(), and scanDir().
| bool zypp::parser::ProductFileReader::scanDir | ( | const Consumer & | consumer_r, |
| const Pathname & | dir_r | ||
| ) | [static] |
Parse all files (no symlinks) in dir_r and call consumer_r for each ProductFileData parsed.
Returns false if the _consumer requested to stop parsing.
Definition at line 248 of file ProductFileReader.cc.
References for_, parse(), zypp::filesystem::readdir(), and WAR.
| ProductFileData zypp::parser::ProductFileReader::scanFile | ( | const Pathname & | file_r | ) | [static] |
Parse one file (or symlink) and return the ProductFileData parsed.
Definition at line 269 of file ProductFileReader.cc.
References zypp::functor::getFirst(), and WAR.
Definition at line 167 of file ProductFileReader.h.
Referenced by consumer(), parse(), and setConsumer().
1.7.6.1