15#include <zypp/base/String.h>
16#include <zypp/base/Logger.h>
17#include <zypp/base/Regex.h>
19#include <zypp/Pathname.h>
22#include <zypp/CheckSum.h>
27#undef ZYPP_BASE_LOGGER_LOGGROUP
28#define ZYPP_BASE_LOGGER_LOGGROUP "parser::yum"
74 {
return ByteCount( str::strtonum<ByteCount::SizeType>(
reader_r.nodeText().asString() ) ); }
120 if (
reader_r->name() ==
"location" )
128 if (
reader_r->name() ==
"checksum" )
135 if (
reader_r->name() ==
"header-checksum" )
142 if (
reader_r->name() ==
"timestamp" )
156 if (
reader_r->name() ==
"header-size" )
163 if (
reader_r->name() ==
"content" )
165 const auto & tag =
reader_r.nodeText();
166 if ( tag.c_str() && *tag.c_str() )
208 {
return _pimpl->keywords(); }
212 std::vector<std::pair<std::string,std::string>>
ret;
213 for (
const std::string & tag :
keywords() ) {
217 if ( tag.compare( 0,10,
"gpg-pubkey" ) != 0 )
220 static const str::regex rx(
"^(gpg-pubkey([^?]*))(\\?fpr=([[:xdigit:]]{8,}))?$" );
223 std::string
keyfile { what[1] };
225 if ( what.
size(4) != std::string::npos ) {
234 DBG <<
"Tag " << tag <<
" does not contain a keyident. ignore it." << endl;
Interface of repomd.xml file reader.
Reference counted access to a Tp object calling a custom Dispose function when the last AutoDispose h...
Store and operate with byte count.
CheckSum getChecksum(Reader &reader_r)
Retrieve a checksum node.
bool consumeNode(Reader &reader_r)
Callback provided to the XML parser.
const std::set< std::string > & keywords() const
repo keywords parsed on the fly
ByteCount getSize(Reader &reader_r)
Retrieve a size node.
std::set< std::string > _keywords
repo keywords parsed on the fly
std::string _typeStr
The resource type string.
OnMediaLocation _location
Location of metadata file.
ProcessResource _callback
Function for processing collected data.
Impl(const Pathname &repomd_file, ProcessResource &&callback)
Ctro taking a ProcessResource callback.
RW_pointer< Impl, rw_pointer::Scoped< Impl > > _pimpl
function< bool(OnMediaLocation &&, const std::string &)> ProcessResource
Callback taking OnMediaLocation and the resource type string.
RepomdFileReader(const Pathname &repomd_file, ProcessResource callback)
CTOR.
const std::set< std::string > & keywords() const
repo keywords parsed on the fly
std::vector< std::pair< std::string, std::string > > keyhints() const
gpg key hits shipped in keywords (bsc#1184326)
Regular expression match result.
xmlTextReader based interface to iterate xml streams.
boost::noncopyable NonCopyable
Ensure derived classes cannot be copied.
bool regex_match(const std::string &s, smatch &matches, const regex ®ex)
\relates regex \ingroup ZYPP_STR_REGEX \relates regex \ingroup ZYPP_STR_REGEX
Easy-to use interface to the ZYPP dependency resolver.