cUPnPWebServer Class Reference

#include <upnpwebserver.h>

Collaboration diagram for cUPnPWebServer:

Collaboration graph
[legend]

List of all members.

Public Member Functions

bool init ()
bool uninit ()

Static Public Member Functions

static cUPnPWebServergetInstance (const char *rootdir="/")
static int getInfo (const char *filename, struct File_Info *info)
static UpnpWebFileHandle open (const char *filename, UpnpOpenFileMode mode)
static int read (UpnpWebFileHandle fh, char *buf, size_t buflen)
static int write (UpnpWebFileHandle fh, char *buf, size_t buflen)
static int seek (UpnpWebFileHandle fh, off_t offset, int origin)
static int close (UpnpWebFileHandle fh)

Friends

class cUPnPServer


Detailed Description

The internal webserver

This is the internal webserver. It distributes all the contents of the UPnP-Server.


Member Function Documentation

int cUPnPWebServer::close ( UpnpWebFileHandle  fh  )  [static]

Closes the file

closes the opened file

Returns 0 on success, non-zero value otherwise

Returns:
0 on success, non-zero value otherwise
Parameters:
fh the file handle of the opened file

int cUPnPWebServer::getInfo ( const char *  filename,
struct File_Info *  info 
) [static]

Retrieve file information

Returns file related information for an virtual directory file

Returns:
0 on success, -1 otherwise
Parameters:
filename The filename of which the information is gathered
info The File_Info structure with the data

cUPnPWebServer * cUPnPWebServer::getInstance ( const char *  rootdir = "/"  )  [static]

Returns the instance of the webserver

Returns the instance of the webserver. This will create a single instance of none is existing on the very first call. A subsequent call will return the same instance.

Returns:
the instance of webserver
Parameters:
rootdir the root directory of the webserver

bool cUPnPWebServer::init ( void   ) 

Initializes the webserver

It enables the webserver which comes with the Intel SDK and creates virtual directories for shares media.

Returns:
returns
  • true, if initializing was successful
  • false, otherwise

UpnpWebFileHandle cUPnPWebServer::open ( const char *  filename,
UpnpOpenFileMode  mode 
) [static]

Opens a virtual directory file

Opens a file in a virtual directory with the specified mode.

Possible modes are:

  • UPNP_READ, Opens the file for reading
  • UPNP_WRITE, Opens the file for writing

It returns a file handle to the opened file, NULL otherwise

Returns:
FileHandle to the opened file, NULL otherwise
Parameters:
filename The file to open
mode UPNP_WRITE for writing, UPNP_READ for reading.

int cUPnPWebServer::read ( UpnpWebFileHandle  fh,
char *  buf,
size_t  buflen 
) [static]

Reads from the opened file

Reads buflen bytes from the file and stores the content to the buffer

Returns 0 no more bytes read (EOF) >0 bytes read from file

Returns:
number of bytes read, 0 on EOF
Parameters:
fh the file handle of the opened file
buf the buffer to write the bytes to
buflen the maximum count of bytes to read

int cUPnPWebServer::seek ( UpnpWebFileHandle  fh,
off_t  offset,
int  origin 
) [static]

Seek in the file

Seeks in the opened file and sets the file pointer to the specified offset

Returns 0 on success, non-zero value otherwise

Returns:
0 on success, non-zero value otherwise
Parameters:
fh the file handle of the opened file
offset a negative oder positive value which moves the pointer forward or backward
origin SEEK_CUR, SEEK_END or SEEK_SET

bool cUPnPWebServer::uninit ( void   ) 

Uninitializes the webserver

This stops the webserver.

Returns:
returns
  • true, if initializing was successful
  • false, otherwise

int cUPnPWebServer::write ( UpnpWebFileHandle  fh,
char *  buf,
size_t  buflen 
) [static]

Writes to the opened file

Writes buflen bytes from the buffer and stores the content in the file

Returns >0 bytes wrote to file, maybe less the buflen in case of write errors

Returns:
number of bytes read, 0 on EOF
Parameters:
fh the file handle of the opened file
buf the buffer to read the bytes from
buflen the maximum count of bytes to write


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

Generated on Sun Nov 8 15:44:09 2009 for UPnP/DLNA plugin for VDR by  doxygen 1.5.8