23 using namespace zypp::xml;
24 using namespace zypp::ws;
36 Impl(
const Pathname &result_file,
42 bool consumeNode(
Reader & reader_r );
48 bool WebpinResultFileReader::Impl::consumeNode(
Reader & reader_r)
50 if ( reader_r->
nodeType() == XML_READER_TYPE_ELEMENT )
53 if ( reader_r->
name() ==
"packages" )
59 if ( reader_r->
name() ==
"package" )
63 if ( reader_r->
name() ==
"name" )
67 if ( reader_r->
name() ==
"version" )
71 if ( reader_r->
name() ==
"summary" )
75 if ( reader_r->
name() ==
"repoURL" )
79 if ( reader_r->
name() ==
"checksum" )
82 if ( reader_r->
name() ==
"distro" )
87 else if ( reader_r->
nodeType() == XML_READER_TYPE_END_ELEMENT )
90 if ( reader_r->
name() ==
"package" )
100 WebpinResultFileReader::Impl::Impl(
const Pathname &result_file,
102 : _callback(callback)
104 Reader reader( result_file );
105 MIL <<
"Reading " << result_file << endl;
Represents a result from http://api.opensuse-community.org/searchservice/Search web service...
std::ostream & operator<<(std::ostream &str, const WebpinResultFileReader &obj)
function< bool(const zypp::ws::WebpinResult &)> ProcessWebpinResult
Callback definition.
Edition represents [epoch:]version[-release]
shared_ptr< WebpinResult > _result
WebpinResultFileReader(const Pathname &result_file, const ProcessWebpinResult &callback)
Constructor.
~WebpinResultFileReader()
Dtor.
ProcessWebpinResult _callback
Read packages and repository search result data from from webpin web search results.
RW_pointer< Impl, rw_pointer::Scoped< Impl > > _pimpl
XmlString name() const
The qualified name of the node, equal to Prefix :LocalName.
std::string asString() const
Explicit conversion to std::string.
XmlString nodeText()
If the curent node is not empty, advances the reader to the next node, and returns the value...
bool foreachNode(ProcessNode fnc_r)
static CheckSum sha1(const std::string &checksum)
NodeType nodeType() const
Get the node type of the current node.
bool consumeNode(Reader &reader_r)
Callback provided to the XML parser.
xmlTextReader based interface to iterate xml streams.