]> git.tdb.fi Git - libs/net.git/blob - source/http/header.h
Mark special member functions as defaulted where appropriate
[libs/net.git] / source / http / header.h
1 #ifndef MSP_HTTP_HEADER_H_
2 #define MSP_HTTP_HEADER_H_
3
4 #include <map>
5 #include <string>
6 #include <vector>
7
8 namespace Msp {
9 namespace Http {
10
11 class Message;
12
13 struct Header
14 {
15         enum Style
16         {
17                 DEFAULT,
18                 SINGLE_VALUE,
19                 LIST,
20                 KEY_VALUE_LIST,
21                 VALUE_WITH_ATTRIBUTES,
22                 LIST_WITH_ATTRIBUTES
23         };
24
25         struct Value
26         {
27                 std::string value;
28                 std::map<std::string, std::string> parameters;
29         };
30
31         std::string name;
32         Style style;
33         std::string raw_value;
34         std::vector<Value> values;
35
36         Header() = default;
37         Header(const Message &, const std::string &, Style = DEFAULT);
38         Header(const std::string &, const std::string &, Style = DEFAULT);
39
40         static Style get_default_style(const std::string &);
41
42         void parse();
43 };
44
45 } // namespace Http
46 } // namespace Msp
47
48 #endif