WebPage Class Reference
[Webserver]

The basic class for publishing data in the web. More...

#include <webpage.h>

Inheritance diagram for WebPage:

Inheritance graph
[legend]
List of all members.

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)

Detailed Description

The basic class for publishing data in the web.

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.


Constructor & Destructor Documentation

WebPage::WebPage ( const char *  uri  ) 

Constructor.

Parameters:
uri the URI, on which to respond (send(WebSrvClient*) will be called, when this uri is requested). uri always has to start with a '/'!


Member Function Documentation

int WebPage::send ( WebSrvClient *  client,
Uint32 &  responsecode 
) [virtual]

Use this function in derived classes to respond on requests.

Parameters:
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
Returns:
the number of bytes sent to the client

Reimplemented in WebFilePage, WebForwardPage, and WebStatisticsPage.

virtual const char* WebPage::getURI (  )  const [inline, virtual]

Returns:
the URI, with which the class was created
See also:
WebPage( const char * )

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.

Parameters:
client the client to respond to
str the NULL-terminated string, that should be sent to the client
Returns:
the number of bytes sent.

void WebPage::setURI ( const char *  uri  )  [protected]

Changes the URI on which to respond.

Parameters:
uri the new URI to respond on, is has to begin with a '/'


The documentation for this class was generated from the following files:
Generated on Wed May 9 17:36:37 2007 for netrinjo by  doxygen 1.5.1