9#ifndef ZYPP_MEDIA_NG_HEADERVALUEMAP_H_INCLUDED
10#define ZYPP_MEDIA_NG_HEADERVALUEMAP_H_INCLUDED
15#include <boost/iterator/iterator_adaptor.hpp>
16#include <zypp-core/base/PtrTypes.h>
23 using value_type = std::variant<std::monostate, std::string, int32_t, int64_t, double, bool>;
46 const std::string &
asString ()
const;
47 int32_t
asInt ()
const;
73 using ValueMap = std::map<std::string, std::vector<Value>>;
78 :
public boost::iterator_adaptor<
79 HeaderValueMap::const_iterator
80 , ValueMap::const_iterator
81 , const std::pair<std::string, Value>
90 { this->base_reference() = val; }
95 const std::string &
key ()
const {
96 return this->base_reference()->first;
100 auto &l = base_reference ()->second;
110 this->base_reference() = ++this->base_reference();
115 return std::make_pair(
key(),
value() );
122 bool contains(
const std::string &key )
const;
123 bool contains(
const std::string_view &key )
const {
127 void set(
const std::string &key,
const Value &val );
128 void set(
const std::string &key,
Value &&val );
129 void add(
const std::string &key,
const Value &val);
131 ValueMap::size_type
size() const noexcept;
137 return values( std::string(key) );
140 const std::vector<Value> &
values (
const std::string_view &key )
const {
141 return values( std::string(key) );
156 const_iterator
erase(
const const_iterator &i );
157 bool erase(
const std::string &key );
String related utilities and Regular expression matching.
Easy-to use interface to the ZYPP dependency resolver.
zyppng::HeaderValue::value_type * rwcowClone< zyppng::HeaderValue::value_type >(const zyppng::HeaderValue::value_type *rhs)
RW_pointer supporting 'copy on write' functionality.