#include <webpage.h>
Inheritance diagram for WebPage:
Public Member Functions | |
DECLSPEC | WebPage (const char *uri) |
virtual DECLSPEC int | send (WebSrvClient *client, Uint32 &responsecode) |
virtual const char * | getURI () const |
Protected Member Functions | |
DECLSPEC void | setURI (const char *uri) |
Static Protected Member Functions | |
static int | sendString (WebSrvClient *client, const char *str) |
This class should not be used directly (it can, but it does not make much sense). Derive it, or use the derived classes WebFilePage and WebForwardPage.
This base class registers itself with the given URI at the WebServer-class so that the virtual function send(WebSrvClient*) will be called, when a request with the according URI is recieved.
WebPage::WebPage | ( | const char * | uri | ) |
Constructor.
uri | the URI, on which to respond (send(WebSrvClient*) will be called, when this uri is requested). uri always has to start with a '/'! |
int WebPage::send | ( | WebSrvClient * | client, | |
Uint32 & | responsecode | |||
) | [virtual] |
Use this function in derived classes to respond on requests.
client | the connected client, that is requesting | |
responsecode | the return-code of the page, sent to the client (i.e. 200, when OK; 400 on error...) has to be assigned to this variable |
Reimplemented in WebFilePage, WebForwardPage, and WebStatisticsPage.
virtual const char* WebPage::getURI | ( | ) | const [inline, virtual] |
static int WebPage::sendString | ( | WebSrvClient * | client, | |
const char * | str | |||
) | [inline, static, protected] |
This is a useful simple function to respond to a client with a string.
client | the client to respond to | |
str | the NULL-terminated string, that should be sent to the client |
void WebPage::setURI | ( | const char * | uri | ) | [protected] |
Changes the URI on which to respond.
uri | the new URI to respond on, is has to begin with a '/' |