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" )
138 _type =
ResourceType(reader_r->getAttribute(
"type").asString());
143 if ( reader_r->name() ==
"location" )
146 _location.setLocation( reader_r->getAttribute(
"href").asString(), 1 );
152 if ( reader_r->name() ==
"checksum" )
155 string checksum_type = reader_r->getAttribute(
"type").asString() ;
156 string checksum_vaue = reader_r.nodeText().asString();
157 _location.setChecksum(
CheckSum( checksum_type, checksum_vaue ) );
162 if ( reader_r->name() ==
"timestamp" )
169 if ( reader_r->name() ==
"size" )
171 string size_value = reader_r.nodeText().asString();
173 _location.setDownloadSize( size );
180 else if ( reader_r->nodeType() == XML_READER_TYPE_END_ELEMENT )
183 if ( reader_r->name() ==
"data" )
RepomdFileReader(const Pathname &repomd_file, const ProcessResource &callback)
CTOR.
Tag
Enumeration of repomd.xml tags.
Store and operate with byte count.
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.
const ProcessCredentials & _callback
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.
Interface of repomd.xml file reader.
ProcessResource _callback
Function for processing collected data.