C++ API Library Reference
Public Functions | Public Static Functions | List of all members
ContentInfo Class Reference

The ContentInfo class represents content information in terms of content type and bytes.

The ResourceManager stores resources as ContentInfo objects. Objects of this type can also be passed to RenderTarget for streaming to client-side views, although this bypasses PureWeb's imaging pipeline and requires you to provide a client-side custom renderer implementation.

Public Functions

ByteArray const & Bytes () const
 
ContentInfo Clone ()
 
bool IsEmpty () const
 
SizeType Length () const
 
String const & Type () const
 
Constructors and Destructors
Note
The type parameter in the constructor can be any mime type, such as PDF (application/pdf), PNG (image/png), or plain text (text/plain). If a type is not specified, it is assumed to be application/octet-stream by default.
 ContentInfo ()
 
 ContentInfo (String const &type)
 
 ContentInfo (String const &type, ByteArray const &bytes)
 
 ContentInfo (ByteArray const &bytes)
 
 ~ContentInfo ()
 

Public Static Functions

static ContentInfo const & Empty ()
 

Usage Description

ByteArray const& Bytes ( ) const
inline

Returns the underlying byte array containing the content.

ContentInfo Clone ( )
inline

Creates a copy of the content.

If your application allows end users to make changes to files stored as ContentInfo objects, this method can be useful to backup and restore the original.

ContentInfo const & Empty ( )
static

Returns an empty instance of ContentInfo.

bool IsEmpty ( ) const
inline

Returns a Boolean value indicating whether this instance of ContentInfo is empty.

SizeType Length ( ) const
inline

Returns the length of the content.

String const& Type ( ) const
inline

Returns the mime type of the content, as it was set in the constructor.