|
Fawkes API
Fawkes Development Version
|
Static web reply. More...
#include <>>

Public Member Functions | |
| StaticWebReply (response_code_t code, std::string body="") | |
| Constructor. | |
| void | append_body (const char *format,...) |
| Append to body. | |
| StaticWebReply & | operator+= (std::string text) |
| Append simple text line. | |
| virtual const std::string & | body () |
| Get body. | |
| virtual std::string::size_type | body_length () |
| Get length of body. | |
| virtual void | pack () |
| Pack the data. | |
Public Member Functions inherited from fawkes::WebReply | |
| WebReply (response_code_t code) | |
| Constructor. | |
| virtual | ~WebReply () |
| Destructor. | |
| response_code_t | code () const |
| Get response code. | |
| void | add_header (std::string header, std::string content) |
| Add a HTTP header. | |
| void | add_header (std::string header_string) |
| Add a HTTP header. | |
| const HeaderMap & | headers () const |
| get headers. | |
Protected Attributes | |
| std::string | _body |
| Body of the reply. | |
Static web reply.
The static web reply is send out as a whole at once and is immediately deleted after sending. Use it for regular-sized pages and content.
| fawkes::StaticWebReply::StaticWebReply | ( | response_code_t | code, |
| std::string | body = "" |
||
| ) |
| void fawkes::StaticWebReply::append_body | ( | const char * | format, |
| ... | |||
| ) |
Append to body.
| format | format of the text to append. Supports the same format as printf(). |
Definition at line 179 of file reply.cpp.
References _body.
Referenced by WebviewStartPageRequestProcessor::process_request(), WebviewPluginsRequestProcessor::process_request(), RRDWebRequestProcessor::process_request(), and WebviewBlackBoardRequestProcessor::process_request().
|
virtual |
Get body.
Reimplemented in fawkes::WebPageReply.
Definition at line 208 of file reply.cpp.
References _body.
Referenced by StaticWebReply().
|
virtual |
Get length of body.
Reimplemented in fawkes::WebPageReply.
Definition at line 218 of file reply.cpp.
References _body.
| StaticWebReply & fawkes::StaticWebReply::operator+= | ( | std::string | text | ) |
|
virtual |
Pack the data.
This method is called just before the reply is sent. You can implement this method if you need to compose your reply before body() and body_length() provide valid output.
Reimplemented in fawkes::WebPageReply.
|
protected |
Body of the reply.
Definition at line 139 of file reply.h.
Referenced by append_body(), body(), body_length(), operator+=(), fawkes::WebPageReply::pack(), StaticWebReply(), and fawkes::WebErrorPageReply::WebErrorPageReply().