Wt::WMemoryResource Class Reference

A Resource which streams data from memory. More...

#include <WMemoryResource>

Inherits Wt::WResource.

Inheritance diagram for Wt::WMemoryResource:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 WMemoryResource (const std::string mimeType, const std::vector< char > &data)
 Create a new resource with given mime-type and data.
void setData (const std::vector< char > &data)
 Set new data for the resource to serve.
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)
 Stream the data for this resource.

Detailed Description

A Resource which streams data from memory.

Use this resource if you want to serve resource data from memory. This is suitable for relatively small resources, which still require some computation.

If you require little computation for creating the data, then you may want to reimplement WResource and compute the data on the fly while streaming.

If you have a lot of data, you may want to use a WFileResource instead.


The documentation for this class was generated from the following files:
Generated on Sun Jul 1 19:37:18 2007 for Wt by doxygen 1.4.7