C++ API Library Reference  4.3.2-74-ge1d4cca
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
 
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 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.