X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fhttp%2Fheader.h;h=1beb95f01f5327ff6ed40a0dc2ffde5cda35279d;hb=f17a55dc7fc44d1516db445550f55ed31e7534fa;hp=202b844110b1044d360eec00baaa30d6db8f94ad;hpb=451c140747bef1829d55d20a33dd3543b9ab8c98;p=libs%2Fnet.git diff --git a/source/http/header.h b/source/http/header.h index 202b844..1beb95f 100644 --- a/source/http/header.h +++ b/source/http/header.h @@ -4,14 +4,25 @@ #include #include #include +#include namespace Msp { namespace Http { class Message; -struct Header +struct MSPNET_API Header { + enum Style + { + DEFAULT, + SINGLE_VALUE, + LIST, + KEY_VALUE_LIST, + VALUE_WITH_ATTRIBUTES, + LIST_WITH_ATTRIBUTES + }; + struct Value { std::string value; @@ -19,12 +30,15 @@ struct Header }; std::string name; + Style style; std::string raw_value; std::vector values; - Header() { } - Header(const Message &, const std::string &); - Header(const std::string &, const std::string &); + Header() = default; + Header(const Message &, const std::string &, Style = DEFAULT); + Header(const std::string &, const std::string &, Style = DEFAULT); + + static Style get_default_style(const std::string &); void parse(); };