ContentAccess::CCafMimeHeader Class Reference
class ContentAccess::CCafMimeHeader : public CBase |
Packages the MIME header information for easy use by a Content Access Agent.
The "Content-Type" MIME header must be correct; other fields are optional from CAF's perspective, but may be mandatory for some agents.
Consider the following MIME header
Content-type: application/vnd.oma.drm.content;
Content-Length: 1234
X-Oma-Drm-Separate-Delivery: 12
The CCafMimeHeader is constructed as follows:
// initialise the header with the content type
_LIT8(KMyMime,"application/vnd.oma.drm.content");
CCafMimeHeader *header = CCafMimeHeader::NewL(KMyMime());
// Set the content length
_LIT8(KMyLength,"1234");
header->SetStandardMimeDataL(EContentLength, KMyLength());
// Set the non-standard header X-Oma-Drm-Separate-Delivery
_LIT8(KMyField,"X-Oma-Drm-Separate-Delivery");
_LIT8(KMyData,"12");
header->AddNonStandardMimeL(KMyField(), KMyData());
To retreive the values from the CCafMimeHeader
TPtrC8 contentType = header->StandardMimeData(EContentType); // application/vnd.oma.drm.content
TPtrC8 contentLength = header->StandardMimeData(EContentLength); // 1234
TInt numNonStandard = header->NonStandardMimeCount(); // 1
TPtrC8 field = header->NonStandardMimeField(0); // X-Oma-Drm-Separate-Delivery
TPtrC8 data = header->NonStandardMimeData(0); // 12
Inherits from
- ContentAccess::CCafMimeHeader
Constructor & Destructor Documentation
CCafMimeHeader()
CCafMimeHeader | ( | ) | [private] |
~CCafMimeHeader()
IMPORT_C | ~CCafMimeHeader | ( | ) | [virtual] |
Member Functions Documentation
AddNonStandardMimeL(const TDesC8 &, const TDesC8 &)
IMPORT_C void | AddNonStandardMimeL | ( | const TDesC8 & | aFieldName, |
| const TDesC8 & | aData |
| ) | |
Adds a new non-standard MIME header field.
e.g., OMA requires a MIME header "X-Oma-Drm-Separate-Delivery".
Parameters
const TDesC8 & aFieldName | The .... |
const TDesC8 & aData | The data corresponding to the MIME header. |
ConstructL(const TDesC8 &)
void | ConstructL | ( | const TDesC8 & | aContent_Type | ) | [private] |
ExternalizeL(RWriteStream &)
Externalizes the CCafMimeHeader object.
Allows the MIME header information to be passed between the client proxy and the CA agent server.
Parameters
RWriteStream & aStream | The stream to write the header information to. |
InternalizeL(RReadStream &)
Internalize the CCafMimeHeader object.
Allows the MIME header information to be passed between the client proxy and the CA agent server.
Parameters
RReadStream & aStream | The stream to read the header information from. |
NewL(const TDesC8 &)
This creates the CCafMimeHeader object and calls SetFieldDataL(EContentType, aContent_Type);
A CCafMimeHeader must have a valid EContentType field, so the only constructor available requires this as a parameter.
Parameters
const TDesC8 & aContent_Type | The "Content-Type :" field from the MIME header. |
NonStandardMimeCount()
IMPORT_C TInt | NonStandardMimeCount | ( | ) | const |
The number of non-standard MIME header fields.
e.g., OMA requires a MIME header "X-Oma-Drm-Separate-Delivery".
NonStandardMimeData(TInt)
IMPORT_C TPtrC8 | NonStandardMimeData | ( | TInt | aIndex | ) | const |
Retrieves the data for a non-standard MIME header.
Parameters
TInt aIndex | The index of the non-standard MIME header. |
NonStandardMimeField(TInt)
IMPORT_C TPtrC8 | NonStandardMimeField | ( | TInt | aIndex | ) | const |
Retrieves the field name for a non-standard MIME header.
Parameters
TInt aIndex | The index of the non-standard MIME header. |
SetStandardMimeDataL(const TMimeFields &, const TDesC8 &)
Sets the MIME data associated with a standard MIME field.
Parameters
const TMimeFields & aIndex | The TMimeFields MIME header field. |
const TDesC8 & aData | The data corresponding to the MIME header. |
StandardMimeData(const TMimeFields &)
Gets the data associated with the standard MIME field.
Parameters
const TMimeFields & aIndex | The TMimeFields MIME header to retrieve corresponding to the MIME data. |
Member Data Documentation
RPointerArray< CMimeFieldAndData > iNonStandardMimeHeaders
Non-standard header fields, some agents (e.g., OMA) need access to other MIME headers.
HBufC8 * iStandardMimeHeader
HBufC8 * | iStandardMimeHeader | [private] |
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.