25#include <zypp/base/String.h>
81 struct KVMapBase :
public std::map<std::string,std::string> {
86 typedef std::map<std::string,std::string>
map_type;
98 return( find(
key_r ) != end() );
104 template<
char kv,
char f>
116 std::vector<std::string>
fields;
119 for (
unsigned i = 0;
i <
fields.size(); ++
i ) {
121 if (
pos == std::string::npos ) {
140 if ( !
ret.empty() ) {
144 if ( !
it->second.empty() ) {
172 template<
typename KVMapOpts>
197 template<
typename KVMapOpts>
199 {
return str <<
obj.asString(); }
Reference counted access to a Tp object calling a custom Dispose function when the last AutoDispose h...
String related utilities and Regular expression matching.
unsigned split(const C_Str &line_r, TOutputIterator result_r, const C_Str &sepchars_r=" \t", const Trim trim_r=NO_TRIM)
Split line_r into words.
Easy-to use interface to the ZYPP dependency resolver.
std::ostream & operator<<(std::ostream &str, const SerialNumber &obj)
A map of (key,value) strings.
std::string asString() const
KVMap(const map_type &map_r)
KVMap(const std::string &str_r)
KVMapPolicy for KVMaps using a single char as separator (e.g.
Base class for KVMaps, (key,value) pairs.
bool has(const std::string &key_r) const
Test whether key is set.
KVMapBase(const map_type &kvmap_r)
static map_type split(const std::string &str_r, const KVMapPolicy &opts_r)
Split str_r into (key,value) map, using the separators defined by opts_r.
std::map< std::string, std::string > map_type
(key,value) map type
static std::string join(const map_type &kvmap_r, const KVMapPolicy &opts_r)
Join (key,value) map into string, using the separators defined by opts_r.
KVMapPolicy for conversion of KVMaps to/from string.
KVMapPolicy(const std::string &kvsplit_r, const std::string &fsplit_r, const std::string &kvjoin_r)
KVMapPolicy(const std::string &kvsplit_r, const std::string &fsplit_r, const std::string &kvjoin_r, const std::string &fjoin_r)
KVMapPolicy(const std::string &kvsplit_r, const std::string &fsplit_r)