9 #ifndef ZYPP_MEDIA_NG_HEADERVALUEMAP_H_INCLUDED 10 #define ZYPP_MEDIA_NG_HEADERVALUEMAP_H_INCLUDED 15 #include <boost/iterator/iterator_adaptor.hpp> 23 using value_type = std::variant<std::monostate, std::string, int32_t, int64_t, bool>;
45 const std::string &
asString ()
const;
46 int32_t
asInt ()
const;
70 using ValueMap = std::map<std::string, std::vector<Value>>;
75 :
public boost::iterator_adaptor<
76 HeaderValueMap::const_iterator
77 , ValueMap::const_iterator
78 , std::pair<std::string, Value>
80 , const std::pair<const std::string&, const Value&>
88 { this->base_reference() = val; }
93 const std::string &
key ()
const {
94 return this->base_reference()->first;
98 auto &l = base_reference ()->second;
108 this->base_reference() = ++this->base_reference();
113 return std::pair<const std::string&, const Value&>(
key(),
value() );
118 HeaderValueMap( std::initializer_list<ValueMap::value_type> init );
120 bool contains(
const std::string &key )
const;
121 bool contains(
const std::string_view &key )
const {
125 void set(
const std::string &key,
Value val );
126 void set(
const std::string &key, std::vector<Value> val );
127 void add(
const std::string &key,
const Value &val);
135 return values( std::string(key) );
138 const std::vector<Value> &
values (
const std::string_view &key )
const {
139 return values( std::string(key) );
154 const_iterator
erase(
const const_iterator &i );
155 bool erase(
const std::string &key );
String related utilities and Regular expression matching.
Easy-to use interface to the ZYPP dependency resolver.