35 Minio::Http::HeaderValueCollection entries;
38 typedef Minio::Http::HeaderValueCollection::iterator iterator;
39 typedef Minio::Http::HeaderValueCollection::const_iterator const_iterator;
41 iterator begin() {
return entries.begin();}
42 const_iterator begin()
const {
return entries.begin();}
44 iterator end() {
return entries.end();}
45 const_iterator end()
const {
return entries.end();}
47 std::pair<iterator, iterator> equal_range(
const std::string & key) {
48 return entries.equal_range(key);
51 std::pair<const_iterator, const_iterator> equal_range(
const std::string & key)
const {
52 return entries.equal_range(key);
55 void Clear() {entries.clear();}
57 bool Exists(
const std::string & key)
const {
return (entries.find(key) != entries.end());}
61 bool Get(
const std::string & key, std::string & value)
const {
62 const_iterator val = entries.find(key);
63 if(val != entries.end()) value = val->second;
64 return (val != entries.end());
67 bool Get(
const std::string & key,
double & value)
const {
68 const_iterator val = entries.find(key);
69 if(val != entries.end()) value = strtod(val->second.c_str(), NULL);
70 return (val != entries.end());
73 bool Get(
const std::string & key,
int & value)
const {
74 const_iterator val = entries.find(key);
75 if(val != entries.end()) value = strtol(val->second.c_str(), NULL, 0);
76 return (val != entries.end());
79 bool Get(
const std::string & key,
long & value)
const {
80 const_iterator val = entries.find(key);
81 if(val != entries.end()) value = strtol(val->second.c_str(), NULL, 0);
82 return (val != entries.end());
85 bool Get(
const std::string & key,
size_t & value)
const {
86 const_iterator val = entries.find(key);
87 if(val != entries.end()) value = strtol(val->second.c_str(), NULL, 0);
88 return (val != entries.end());
93 const std::string & GetWithDefault(
const std::string & key,
const std::string & defaultVal)
const {
94 const_iterator val = entries.find(key);
95 return (val != entries.end())? val->second : defaultVal;
98 double GetWithDefault(
const std::string & key,
double defaultVal)
const {
99 const_iterator val = entries.find(key);
100 return (val != entries.end())? strtod(val->second.c_str(), NULL) : defaultVal;
103 int GetWithDefault(
const std::string & key,
int defaultVal)
const {
104 const_iterator val = entries.find(key);
105 return (val != entries.end())? strtol(val->second.c_str(), NULL, 0) : defaultVal;
108 long GetWithDefault(
const std::string & key,
long defaultVal)
const {
109 const_iterator val = entries.find(key);
110 return (val != entries.end())? strtol(val->second.c_str(), NULL, 0) : defaultVal;
113 size_t GetWithDefault(
const std::string & key,
size_t defaultVal)
const {
114 const_iterator val = entries.find(key);
115 return (val != entries.end())? strtol(val->second.c_str(), NULL, 0) : defaultVal;
119 void Insert(
const std::string & key,
const std::string & value) {
120 entries.insert(std::make_pair(key, value));
124 void Update(
const std::string & key,
const std::string & value) {
125 iterator val = entries.find(key);
126 if(val == entries.end())