StaticWebReply Class Reference
Static web reply. More...
#include <reply.h>

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. | |
Protected Attributes | |
| std::string | _body |
| Body of the reply. | |
Detailed Description
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.
Definition at line 119 of file reply.h.
Constructor & Destructor Documentation
| StaticWebReply::StaticWebReply | ( | response_code_t | code, | |
| std::string | body = "" | |||
| ) |
Member Function Documentation
| void StaticWebReply::append_body | ( | const char * | format, | |
| ... | ||||
| ) |
Append to body.
- Parameters:
-
format format of the text to append. Supports the same format as printf().
Definition at line 151 of file reply.cpp.
References _body.
Referenced by WebStartPageRequestProcessor::process_request(), WebPluginsRequestProcessor::process_request(), and WebBlackBoardRequestProcessor::process_request().
| const std::string & StaticWebReply::body | ( | ) | [virtual] |
Get body.
- Returns:
- reference to body.
Reimplemented in WebPageReply.
Definition at line 180 of file reply.cpp.
References _body.
Referenced by WebRequestDispatcher::queue_static_reply().
| std::string::size_type StaticWebReply::body_length | ( | ) | [virtual] |
Get length of body.
- Returns:
- body length
Reimplemented in WebPageReply.
Definition at line 190 of file reply.cpp.
References _body.
Referenced by WebRequestDispatcher::queue_static_reply().
| StaticWebReply & StaticWebReply::operator+= | ( | std::string | text | ) |
| void StaticWebReply::pack | ( | ) | [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 WebPageReply.
Definition at line 202 of file reply.cpp.
Referenced by WebRequestDispatcher::queue_static_reply().
Member Data Documentation
std::string StaticWebReply::_body [protected] |
Body of the reply.
Definition at line 133 of file reply.h.
Referenced by append_body(), body(), body_length(), operator+=(), WebPageReply::pack(), StaticWebReply(), and WebErrorPageReply::WebErrorPageReply().
The documentation for this class was generated from the following files:

