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" )
162 else if ( reader_r->
nodeType() == XML_READER_TYPE_END_ELEMENT )
165 if ( reader_r->
name() ==
"data" )
185 : _pimpl( new
Impl(repomd_file, callback) )
189 : _pimpl( new
Impl(repomd_file, callback) )
Impl(const Pathname &repomd_file, const ProcessResource2 &callback)
Ctro taking a ProcessResource2 callback.
RepomdFileReader(const Pathname &repomd_file, const ProcessResource &callback)
CTOR.
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.
Tag
Enumeration of repomd.xml tags.
NodeType nodeType() const
Get the node type of the current node.
repo::yum::ResourceType _type
Type of metadata file as enum of well known repoinded.xml entries.
const ProcessCredentials & _callback
boost::noncopyable NonCopyable
Ensure derived classes cannot be copied.
OnMediaLocation _location
Location of metadata file.
XmlString getAttribute(const char *name_r) const
Provides a copy of the attribute value with the specified qualified name.
ProcessResource2 _callback
Function for processing collected data.
Tag _tag
Used to remember currently processed tag.
Impl(const Pathname &repomd_file, const ProcessResource &callback)
XmlString nodeText()
If the current node is not empty, advances the reader to the next node, and returns the value...
std::string asString() const
Explicit conversion to std::string.
bool foreachNode(ProcessNode fnc_r)
XmlString name() const
The qualified name of the node, equal to Prefix :LocalName.
Interface of repomd.xml file reader.
Easy-to use interface to the ZYPP dependency resolver.
function< bool(const OnMediaLocation &, const repo::yum::ResourceType &)> ProcessResource
Callbacl taking OnMediaLocation and repo::yum::ResourceType.
xmlTextReader based interface to iterate xml streams.