]> git.tdb.fi Git - libs/net.git/blobdiff - source/http/header.h
Add a utility struct for parsing complex header values
[libs/net.git] / source / http / header.h
diff --git a/source/http/header.h b/source/http/header.h
new file mode 100644 (file)
index 0000000..202b844
--- /dev/null
@@ -0,0 +1,35 @@
+#ifndef MSP_HTTP_HEADER_H_
+#define MSP_HTTP_HEADER_H_
+
+#include <map>
+#include <string>
+#include <vector>
+
+namespace Msp {
+namespace Http {
+
+class Message;
+
+struct Header
+{
+       struct Value
+       {
+               std::string value;
+               std::map<std::string, std::string> parameters;
+       };
+
+       std::string name;
+       std::string raw_value;
+       std::vector<Value> values;
+
+       Header() { }
+       Header(const Message &, const std::string &);
+       Header(const std::string &, const std::string &);
+
+       void parse();
+};
+
+} // namespace Http
+} // namespace Msp
+
+#endif