Go to the documentation of this file.
24 #undef ZYPP_BASE_LOGGER_LOGGROUP
25 #define ZYPP_BASE_LOGGER_LOGGROUP "parser::yum"
69 Reader reader( repomd_file );
70 MIL <<
"Reading " << repomd_file << endl;
71 reader.
foreachNode( bind( &RepomdFileReader::Impl::consumeNode,
this, _1 ) );
81 bool consumeNode(
Reader & reader_r );
113 bool RepomdFileReader::Impl::consumeNode(
Reader & reader_r )
115 if ( reader_r->
nodeType() == XML_READER_TYPE_ELEMENT )
118 if ( reader_r->
name() ==
"repomd" )
125 if ( reader_r->
name() ==
"data" )
134 if ( reader_r->
name() ==
"location" )
143 if ( reader_r->
name() ==
"checksum" )
148 _location.setChecksum(
CheckSum( checksum_type, checksum_vaue ) );
153 if ( reader_r->
name() ==
"timestamp" )
160 if ( reader_r->
name() ==
"size" )
164 _location.setDownloadSize( size );
171 else if ( reader_r->
nodeType() == XML_READER_TYPE_END_ELEMENT )
174 if ( reader_r->
name() ==
"data" )
194 : _pimpl( new
Impl(repomd_file, callback) )
198 : _pimpl( new
Impl(repomd_file, callback) )
xmlTextReader based interface to iterate xml streams.
std::string asString() const
Explicit conversion to std::string.
const ProcessCredentials & _callback
Tag _tag
Used to remember currently processed tag.
bool foreachNode(ProcessNode fnc_r)
RepomdFileReader(const Pathname &repomd_file, const ProcessResource &callback)
CTOR.
function< bool(const OnMediaLocation &, const repo::yum::ResourceType &)> ProcessResource
Callbacl taking OnMediaLocation and repo::yum::ResourceType.
repo::yum::ResourceType _type
Type of metadata file as enum of well known repoinded.xml entries.
Store and operate with byte count.
ProcessResource2 _callback
Function for processing collected data.
boost::noncopyable NonCopyable
Ensure derived classes cannot be copied.
NodeType nodeType() const
Get the node type of the current node.
XmlString getAttribute(const char *name_r) const
Provides a copy of the attribute value with the specified qualified name.
XmlString name() const
The qualified name of the node, equal to Prefix :LocalName.
Easy-to use interface to the ZYPP dependency resolver.
std::string _typeStr
Type of metadata file (string)
function< bool(const OnMediaLocation &, const repo::yum::ResourceType &, const std::string &)> ProcessResource2
Alternate callback also receiving the ResourceType as string.
Impl(const Pathname &repomd_file, const ProcessResource &callback)
Impl(const Pathname &repomd_file, const ProcessResource2 &callback)
Ctro taking a ProcessResource2 callback.
OnMediaLocation _location
Location of metadata file.
XmlString nodeText()
If the current node is not empty, advances the reader to the next node, and returns the value.
Tag
Enumeration of repomd.xml tags.