#include <WFileResource>
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. |
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.
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).
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.