24 #undef ZYPP_BASE_LOGGER_LOGGROUP
25 #define ZYPP_BASE_LOGGER_LOGGROUP "parser::yum"
28 using namespace zypp::xml;
73 bool consumeNode(
Reader & reader_r );
100 RepomdFileReader::Impl::Impl(
105 Reader reader( repomd_file );
106 MIL <<
"Reading " << repomd_file << endl;
125 if ( reader_r->
nodeType() == XML_READER_TYPE_ELEMENT )
128 if ( reader_r->
name() ==
"repomd" )
135 if ( reader_r->
name() ==
"data" )
143 if ( reader_r->
name() ==
"location" )
152 if ( reader_r->
name() ==
"checksum" )
157 _location.setChecksum(
CheckSum( checksum_type, checksum_vaue ) );
162 if ( reader_r->
name() ==
"timestamp" )
171 else if ( reader_r->
nodeType() == XML_READER_TYPE_END_ELEMENT )
174 if ( reader_r->
name() ==
"data" )
177 _callback( _location, _type );
RepomdFileReader(const Pathname &repomd_file, const ProcessResource &callback)
CTOR.
Tag
Enumeration of repomd.xml tags.
Date _timestamp
Metadata file time-stamp.
bool consumeNode(Reader &reader_r)
Callback provided to the XML parser.
CheckSum _checksum
Checksum of metadata file.
repo::yum::ResourceType _type
Type of metadata file.
std::string _checksum_type
Type of checksum of metadata file.
boost::noncopyable NonCopyable
Ensure derived classes cannot be copied.
Store and operate on date (time_t).
OnMediaLocation _location
Location of metadata file.
RW_pointer< Impl, rw_pointer::Scoped< Impl > > _pimpl
function< bool(const OnMediaLocation &, const repo::yum::ResourceType &)> ProcessResource
Callback definition.
Tag _tag
Used to remember currently processed tag.
XmlString name() const
The qualified name of the node, equal to Prefix :LocalName.
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)
Interface of repomd.xml file reader.
ProcessResource _callback
Function for processing collected data.
NodeType nodeType() const
Get the node type of the current node.
xmlTextReader based interface to iterate xml streams.