11#include <promeki/config.h>
12#if PROMEKI_ENABLE_HTTP
21PROMEKI_NAMESPACE_BEGIN
60 PROMEKI_SHARED_FINAL(HttpHeaders)
63 using Ptr = SharedPtr<HttpHeaders>;
66 using List = ::promeki::List<HttpHeaders>;
69 using PtrList = ::promeki::List<Ptr>;
72 HttpHeaders() =
default;
81 void set(
const String &name,
const String &value);
91 void add(
const String &name,
const String &value);
98 void remove(
const String &name);
101 bool contains(
const String &name)
const;
110 String value(
const String &name,
const String &defaultValue = String())
const;
117 StringList values(
const String &name)
const;
128 bool isEmpty()
const {
return count() == 0; }
139 void forEach(Function<
void(
const String &name,
const String &value)> func)
const;
142 bool operator==(
const HttpHeaders &other)
const;
145 bool operator!=(
const HttpHeaders &other)
const {
return !(*
this == other); }
156 static String foldName(
const String &s);
160 using List = ::promeki::List<Entry>;
170 using List = ::promeki::List<KeyBucket>;
171 using IndexList = ::promeki::List<size_t>;
180 Entry::List _entries;
181 KeyBucket::List _index;
183 size_t findBucket(
const String &lower)
const;
184 size_t getOrCreateBucket(
const String &lower);