fawkes::StaticWebReply Class Reference

Static web reply. More...

#include <webview/reply.h>

Inheritance diagram for fawkes::StaticWebReply:

[legend]
List of all members.

Public Member Functions

 StaticWebReply (response_code_t code, std::string body="")
 Constructor.
void append_body (const char *format,...)
 Append to body.
StaticWebReplyoperator+= (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.

Author:
Tim Niemueller

Definition at line 124 of file reply.h.


Constructor & Destructor Documentation

fawkes::StaticWebReply::StaticWebReply ( response_code_t  code,
std::string  body = "" 
)

Constructor.

Parameters:
code HTTP response code
body optional initial body

Definition at line 144 of file reply.cpp.

References _body.


Member Function Documentation

void fawkes::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 156 of file reply.cpp.

References _body.

Referenced by WebviewStartPageRequestProcessor::process_request(), WebviewPluginsRequestProcessor::process_request(), and WebviewBlackBoardRequestProcessor::process_request().

const std::string & fawkes::StaticWebReply::body (  )  [virtual]

Get body.

Returns:
reference to body.

Reimplemented in fawkes::WebPageReply.

Definition at line 185 of file reply.cpp.

References _body.

Referenced by fawkes::WebRequestDispatcher::queue_static_reply().

std::string::size_type fawkes::StaticWebReply::body_length (  )  [virtual]

Get length of body.

Returns:
body length

Reimplemented in fawkes::WebPageReply.

Definition at line 195 of file reply.cpp.

References _body.

Referenced by fawkes::WebRequestDispatcher::queue_static_reply().

StaticWebReply & fawkes::StaticWebReply::operator+= ( std::string  text  ) 

Append simple text line.

Parameters:
text text to append to body
Returns:
reference to this instance

Definition at line 174 of file reply.cpp.

References _body.

void fawkes::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 fawkes::WebPageReply.

Definition at line 207 of file reply.cpp.

Referenced by fawkes::WebRequestDispatcher::queue_static_reply().


Member Data Documentation

std::string fawkes::StaticWebReply::_body [protected]

Body of the reply.

Definition at line 138 of file reply.h.

Referenced by append_body(), body(), body_length(), operator+=(), fawkes::WebPageReply::pack(), StaticWebReply(), and fawkes::WebErrorPageReply::WebErrorPageReply().


The documentation for this class was generated from the following files:
Generated on Tue Feb 22 13:31:42 2011 for Fawkes API by  doxygen 1.4.7