Wt::WFileResource Class Reference

A Resource which streams data from a local file. More...

#include <WFileResource>

Inheritance diagram for Wt::WFileResource:

Inheritance graph
[legend]

List of all members.

Public Member Functions

 WFileResource (const std::string &mimeType, const std::string &fileName)
 Create a new resource with given mime-type and contents stored in filename.
 ~WFileResource ()
 Destroy the resource.
void setFileName (const std::string &fileName)
 Set a (different) filename.
const std::string & fileName () const
 Get the filename.
const std::string & mimeType () const
 Get the mime-type.
void setMimeType (const std::string &mimeType)
 Set the mime-type.

Protected Member Functions

virtual const std::string resourceMimeType () const
 Return the mimetype.
virtual bool streamResourceData (std::ostream &stream, const ArgumentMap &arguments)
 Stream the data for this resource.


Detailed Description

A Resource which streams data from a local file.

To update the resource, either use setFileName() to point it to a new file, or emit dataChanged() if only the file contents has changed, but not the filename.


Constructor & Destructor Documentation

Wt::WFileResource::~WFileResource (  ) 

Destroy the resource.

It is up to the user to make sure that the resource is nog longer in use (by e.g. a WImage).


Member Function Documentation

void Wt::WFileResource::setFileName ( const std::string &  fileName  ) 

Set a (different) filename.

Set the location of the file on the local filesystem which must be streamed for this resource.


The documentation for this class was generated from the following files:
Generated on Mon Apr 14 15:15:01 2008 for Wt by doxygen 1.5.3