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
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

Returns the underlying byte array containing the content.

ContentInfo Clone ( )

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 ( )

Returns an empty instance of ContentInfo.

bool IsEmpty ( ) const

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

SizeType Length ( ) const

Returns the length of the content.

String const& Type ( ) const

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