X-Git-Url: http://git.tdb.fi/?p=libs%2Fnet.git;a=blobdiff_plain;f=source%2Fmessage.h;h=1ccc976ac71c76c3a8517e181a79ac2ab54f27c6;hp=c9dc618a61eb31ce05e972a89f09f49d38ce792c;hb=a4049d7c4126126ca3abd12b1aca8715e7006d44;hpb=070d56e7b0036ca2e4234eb06dcae83ebfb3df34 diff --git a/source/message.h b/source/message.h index c9dc618..1ccc976 100644 --- a/source/message.h +++ b/source/message.h @@ -8,32 +8,40 @@ Distributed under the LGPL #ifndef MSP_HTTP_MESSAGE_H_ #define MSP_HTTP_MESSAGE_H_ +#include #include -#include "misc.h" +#include +#include "version.h" namespace Msp { namespace Http { class Message { +protected: + typedef std::map HeaderMap; + + Version http_version; + HeaderMap headers; + std::string content; + unsigned chunk_length; + bool complete; + Variant user_data; + + Message(); public: virtual ~Message() { } void set_header(const std::string &, const std::string &); const std::string &get_header(const std::string &) const; - const std::string &get_data() const { return data; } + void add_content(const std::string &); + const std::string &get_content() const { return content; } + void set_user_data(const Variant &); + const Variant &get_user_data() const { return user_data; } bool get_complete() const { return complete; } - void add_data(const std::string &); - unsigned parse_data(const std::string &); + unsigned parse_content(const std::string &); virtual std::string str() const =0; protected: - Version http_version; - HeaderMap headers; - std::string data; - unsigned chunk_length; - bool complete; - - Message(); std::string str_common() const; };