Fawkes API  Fawkes Development Version
fawkes::WebErrorPageReply Class Reference

Static error page reply. More...

#include <>>

Inheritance diagram for fawkes::WebErrorPageReply:

Public Member Functions

 WebErrorPageReply (Code error_code, const char *format=NULL,...)
 Constructor. More...
 
- Public Member Functions inherited from fawkes::WebPageReply
 WebPageReply (std::string title, std::string page="")
 Constructor. More...
 
virtual const std::string & body ()
 Get body. More...
 
virtual std::string::size_type body_length ()
 Get length of body. More...
 
virtual void pack ()
 Pack the data. More...
 
virtual void pack (std::string active_baseurl, WebPageHeaderGenerator *headergen, WebPageFooterGenerator *footergen)
 Pack web page reply. More...
 
virtual void set_html_header (std::string h)
 Set HTML header text. More...
 
void set_navbar_enabled (bool enabled)
 Enable or disable the Fawkes Navigationbar (default enabled) More...
 
bool get_navbar_enabled ()
 Is the Fawkes Navigation bar enabled? More...
 
void set_footer_enabled (bool enabled)
 Enable or disable the Fawkes Webview footer (default enabled) More...
 
bool get_footer_enabled ()
 Is the Fawkes Webview footer enabled? More...
 
- Public Member Functions inherited from fawkes::StaticWebReply
 StaticWebReply (Code code, std::string body="")
 Constructor. More...
 
void append_body (const char *format,...)
 Append to body. More...
 
void append_body (const std::string &s)
 Append string to body. More...
 
StaticWebReplyoperator+= (std::string text)
 Append simple text line. More...
 
- Public Member Functions inherited from fawkes::WebReply
 WebReply (Code code)
 Constructor. More...
 
virtual ~WebReply ()
 Destructor. More...
 
Code code () const
 Get response code. More...
 
void set_code (Code code)
 Set response code. More...
 
void add_header (const std::string &header, const std::string &content)
 Add a HTTP header. More...
 
void add_header (const std::string &header_string)
 Add a HTTP header. More...
 
const HeaderMapheaders () const
 get headers. More...
 
void set_caching (bool caching)
 Enable or disable caching for this specific reply. More...
 
void set_request (WebRequest *request)
 Set associated request. More...
 
WebRequestget_request () const
 Get associated request. More...
 
void pack_caching ()
 Called just before the reply is sent. More...
 

Additional Inherited Members

- Public Types inherited from fawkes::WebReply
enum  Code {
  HTTP_CONTINUE = 100 , HTTP_SWITCHING_PROTOCOLS = 101 , HTTP_PROCESSING = 102 , HTTP_OK = 200 ,
  HTTP_CREATED = 201 , HTTP_ACCEPTED = 202 , HTTP_NON_AUTHORITATIVE_INFORMATION = 203 , HTTP_NO_CONTENT = 204 ,
  HTTP_RESET_CONTENT = 205 , HTTP_PARTIAL_CONTENT = 206 , HTTP_MULTI_STATUS = 207 , HTTP_MULTIPLE_CHOICES = 300 ,
  HTTP_MOVED_PERMANENTLY = 301 , HTTP_FOUND = 302 , HTTP_SEE_OTHER = 303 , HTTP_NOT_MODIFIED = 304 ,
  HTTP_USE_PROXY = 305 , HTTP_SWITCH_PROXY = 306 , HTTP_TEMPORARY_REDIRECT = 307 , HTTP_BAD_REQUEST = 400 ,
  HTTP_UNAUTHORIZED = 401 , HTTP_PAYMENT_REQUIRED = 402 , HTTP_FORBIDDEN = 403 , HTTP_NOT_FOUND = 404 ,
  HTTP_METHOD_NOT_ALLOWED = 405 , HTTP_METHOD_NOT_ACCEPTABLE = 406 , HTTP_PROXY_AUTHENTICATION_REQUIRED = 407 , HTTP_REQUEST_TIMEOUT = 408 ,
  HTTP_CONFLICT = 409 , HTTP_GONE = 410 , HTTP_LENGTH_REQUIRED = 411 , HTTP_PRECONDITION_FAILED = 412 ,
  HTTP_REQUEST_ENTITY_TOO_LARGE = 413 , HTTP_REQUEST_URI_TOO_LONG = 414 , HTTP_UNSUPPORTED_MEDIA_TYPE = 415 , HTTP_REQUESTED_RANGE_NOT_SATISFIABLE = 416 ,
  HTTP_EXPECTATION_FAILED = 417 , HTTP_UNPROCESSABLE_ENTITY = 422 , HTTP_LOCKED = 423 , HTTP_FAILED_DEPENDENCY = 424 ,
  HTTP_UNORDERED_COLLECTION = 425 , HTTP_UPGRADE_REQUIRED = 426 , HTTP_RETRY_WITH = 449 , HTTP_INTERNAL_SERVER_ERROR = 500 ,
  HTTP_NOT_IMPLEMENTED = 501 , HTTP_BAD_GATEWAY = 502 , HTTP_SERVICE_UNAVAILABLE = 503 , HTTP_GATEWAY_TIMEOUT = 504 ,
  HTTP_HTTP_VERSION_NOT_SUPPORTED = 505 , HTTP_VARIANT_ALSO_NEGOTIATES = 506 , HTTP_INSUFFICIENT_STORAGE = 507 , HTTP_BANDWIDTH_LIMIT_EXCEEDED = 509 ,
  HTTP_NOT_EXTENDED = 510
}
 HTTP response code. More...
 
typedef std::map< std::string, std::string > HeaderMap
 Map of headers. More...
 
- Static Public Member Functions inherited from fawkes::WebReply
static void set_caching_default (bool caching)
 Enable or disable caching default for replies. More...
 
- Protected Member Functions inherited from fawkes::WebPageReply
 WebPageReply (Code code)
 Base constructor. More...
 
- Protected Attributes inherited from fawkes::WebPageReply
std::string _title
 Title of the page. More...
 
- Protected Attributes inherited from fawkes::StaticWebReply
std::string _body
 Body of the reply. More...
 

Detailed Description

Static error page reply.

Shows a simple error page based on the given code.

Author
Tim Niemueller

Definition at line 30 of file error_reply.h.

Constructor & Destructor Documentation

◆ WebErrorPageReply()

fawkes::WebErrorPageReply::WebErrorPageReply ( Code  code,
const char *  format = NULL,
  ... 
)

Constructor.

Parameters
codeerror code, must be a 4xx or 5xx HTTP code
formatformat for additional error message, use format as known from sprintf.

Definition at line 42 of file error_reply.cpp.

References fawkes::StaticWebReply::_body, fawkes::WebPageReply::_title, fawkes::WebReply::code(), fawkes::WebReply::HTTP_BAD_GATEWAY, fawkes::WebReply::HTTP_BAD_REQUEST, fawkes::WebReply::HTTP_BANDWIDTH_LIMIT_EXCEEDED, fawkes::WebReply::HTTP_CONFLICT, fawkes::WebReply::HTTP_EXPECTATION_FAILED, fawkes::WebReply::HTTP_FAILED_DEPENDENCY, fawkes::WebReply::HTTP_FORBIDDEN, fawkes::WebReply::HTTP_GATEWAY_TIMEOUT, fawkes::WebReply::HTTP_GONE, fawkes::WebReply::HTTP_HTTP_VERSION_NOT_SUPPORTED, fawkes::WebReply::HTTP_INSUFFICIENT_STORAGE, fawkes::WebReply::HTTP_INTERNAL_SERVER_ERROR, fawkes::WebReply::HTTP_LENGTH_REQUIRED, fawkes::WebReply::HTTP_LOCKED, fawkes::WebReply::HTTP_METHOD_NOT_ACCEPTABLE, fawkes::WebReply::HTTP_METHOD_NOT_ALLOWED, fawkes::WebReply::HTTP_NOT_EXTENDED, fawkes::WebReply::HTTP_NOT_FOUND, fawkes::WebReply::HTTP_NOT_IMPLEMENTED, fawkes::WebReply::HTTP_PAYMENT_REQUIRED, fawkes::WebReply::HTTP_PRECONDITION_FAILED, fawkes::WebReply::HTTP_PROXY_AUTHENTICATION_REQUIRED, fawkes::WebReply::HTTP_REQUEST_ENTITY_TOO_LARGE, fawkes::WebReply::HTTP_REQUEST_TIMEOUT, fawkes::WebReply::HTTP_REQUEST_URI_TOO_LONG, fawkes::WebReply::HTTP_REQUESTED_RANGE_NOT_SATISFIABLE, fawkes::WebReply::HTTP_RETRY_WITH, fawkes::WebReply::HTTP_SERVICE_UNAVAILABLE, fawkes::WebReply::HTTP_UNAUTHORIZED, fawkes::WebReply::HTTP_UNORDERED_COLLECTION, fawkes::WebReply::HTTP_UNPROCESSABLE_ENTITY, fawkes::WebReply::HTTP_UNSUPPORTED_MEDIA_TYPE, fawkes::WebReply::HTTP_UPGRADE_REQUIRED, and fawkes::WebReply::HTTP_VARIANT_ALSO_NEGOTIATES.


The documentation for this class was generated from the following files: