WebFilePage Class Reference
[Webserver]

A class for simple publishing of a file in the web. More...

#include <webfilepage.h>

Inheritance diagram for WebFilePage:

Inheritance graph
[legend]
Collaboration diagram for WebFilePage:

Collaboration graph
[legend]
List of all members.

Public Member Functions

DECLSPEC WebFilePage (const char *uri, const char *fn, const char *type=NULL)
virtual DECLSPEC int send (WebSrvClient *client, Uint32 &responsecode)

Protected Attributes

std::string strFilename
 the filename of the file to send, when responding
char chContentType [128]
 the content-type string

Detailed Description

A class for simple publishing of a file in the web.

By creating a WebFilePage, you can make a file being availible via HTTP.


Constructor & Destructor Documentation

WebFilePage::WebFilePage ( const char *  uri,
const char *  fn,
const char *  type = NULL 
)

Constructor. Automatically registers itself to be accessible by HTTP requests.

Parameters:
uri the URI (after the IP address) of the page; when a HTTP request like http://IP-addr"uri" arrives, the function send() will be called. uri has to start with a '/'!
fn the filename (relative to the app's data path) of the file, which should be sent to the requesting host.
type the MIME-type, that should be sent to the requesting host (i.e. "text/html"), if NULL, the type is selected automatically by using the filename's ending.


Member Function Documentation

int WebFilePage::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 from WebPage.


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