26 using namespace zypp::xml;
63 bool consumeNode(
Reader & reader_r );
77 PatchesFileReader::Impl::Impl(
const Pathname & patches_file,
79 : _tag(
tag_NONE), _callback(callback)
81 Reader reader( patches_file );
82 MIL <<
"Reading " << patches_file << endl;
91 std::string data_type;
92 if ( reader_r->
nodeType() == XML_READER_TYPE_ELEMENT )
94 if ( reader_r->
name() ==
"patches" )
99 if ( reader_r->
name() ==
"patch" )
105 if ( reader_r->
name() ==
"location" )
111 if ( reader_r->
name() ==
"checksum" )
116 _location.setChecksum(
CheckSum( checksum_type, checksum_vaue ) );
119 if ( reader_r->
name() ==
"timestamp" )
125 else if ( reader_r->
nodeType() == XML_READER_TYPE_END_ELEMENT )
128 if ( reader_r->
name() ==
"patch" )
129 _callback( _location, _id );
std::string _checksum_type
boost::noncopyable NonCopyable
Ensure derived classes cannot be copied.
Store and operate on date (time_t).
bool consumeNode(Reader &reader_r)
Callback provided to the XML parser.
XmlString name() const
The qualified name of the node, equal to Prefix :LocalName.
Interface of patches.xml file reader.
RW_pointer< Impl, rw_pointer::Scoped< Impl > > _pimpl
std::string asString() const
Explicit conversion to std::string.
XmlString getAttribute(const char *name_r) const
Provides a copy of the attribute value with the specified qualified name.
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)
~PatchesFileReader()
DTOR.
OnMediaLocation _location
PatchesFileReader(const Pathname &patches_file, const ProcessResource &callback)
CTOR.
function< bool(const OnMediaLocation &, const std::string &)> ProcessResource
Callback definition first parameter is a OnMediaLocation object with the resource second parameter is...
NodeType nodeType() const
Get the node type of the current node.
ProcessResource _callback
xmlTextReader based interface to iterate xml streams.