SaltAPI  1.1
An API for the HTTPd / Zia by Salty Studio.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
Message.hpp
Go to the documentation of this file.
1 //
2 // Created by wery_a on 07/01/17.
3 //
4 
5 #ifndef API_V2_MESSAGE_HPP
6 #define API_V2_MESSAGE_HPP
7 
8 #include "Header.hpp"
9 
10 class CommunicationSession;
11 
15 namespace HTTP {
19  class Message {
20  public:
21  Message();
22 
23  virtual ~Message();
24 
25  protected:
26  unsigned char m_http_version_major;
27  unsigned char m_http_version_minor;
28 
30 
31  char *m_body = nullptr;
32 
34 
35  CommunicationSession *m_communicationSession;
36 
37  public:
42  Header &GetHeader();
43 
48  char * const GetBody() const;
49 
54  std::string GetHTTPVersion() const;
55 
61  void SetHTTPVersion(unsigned char major, unsigned char minor);
62 
67  void SetBody(std::string const &body);
68 
69 
75  void SetBody(const char *body, unsigned long size);
76 
81  CommunicationSession *GetSocket() const;
82 
83  };
84 }
85 #endif //API_V2_MESSAGE_HPP
CommunicationSession * GetSocket() const
Definition: Message.cpp:50
unsigned char m_http_version_major
Definition: Message.hpp:26
char *const GetBody() const
Definition: Message.cpp:22
std::string GetHTTPVersion() const
Definition: Message.cpp:26
virtual ~Message()
Definition: Message.cpp:14
Header & GetHeader()
Definition: Message.cpp:18
CommunicationSession * m_communicationSession
Definition: Message.hpp:35
unsigned char m_http_version_minor
Definition: Message.hpp:27
int m_content_length
Definition: Message.hpp:33
Header m_header
Definition: Message.hpp:29
char * m_body
Definition: Message.hpp:31
void SetHTTPVersion(unsigned char major, unsigned char minor)
set version of HTTP
Definition: Message.cpp:33
void SetBody(std::string const &body)
set body
Definition: Message.cpp:38