ContentAccess::RStringAttributeSet Class Reference

class ContentAccess::RStringAttributeSet

Holds the values of a predefined set of attributes based upon ContentAccess::TStringAttribute

It is also possible for an agent to provide an extended set of these attributes beyond EAgentSpecificAttributeBase but only applications written to support that particular agent will support this.

No duplicate attributes are allowed in the set

Public Member Functions
RStringAttributeSet ()
IMPORT_C void AddL ( TInt )
IMPORT_C void Close ()
IMPORT_C TInt Count ()
IMPORT_C void ExternalizeL ( RWriteStream &)
IMPORT_C TInt GetValue ( TInt , TDes &)
IMPORT_C TInt GetValueLength ( TInt )
IMPORT_C void InternalizeL ( RReadStream &)
IMPORT_C TInt SetValue ( TInt , const TDesC &, TInt )
IMPORT_C TInt operator[] ( TInt )
Private Member Functions
void AddL ( TInt , const TDesC &, TInt )
Private Attributes
RPointerArray < CStringAttribute > iAttributes

Constructor & Destructor Documentation

RStringAttributeSet()

IMPORT_C RStringAttributeSet ( )

Member Functions Documentation

AddL(TInt)

IMPORT_C void AddL ( TInt aAttribute )

Add a new attribute to the set The attribute value is initalised with an empty string

Parameters

TInt aAttribute The attribute to add to the set

AddL(TInt, const TDesC &, TInt)

void AddL ( TInt aAttribute,
const TDesC & aValue,
TInt aErrorCode
) [private]

Parameters

TInt aAttribute
const TDesC & aValue
TInt aErrorCode

Close()

IMPORT_C void Close ( )

Release all resources used by the RStringAttributeSet

This must be called before the RStringAttribute set goes out of scope

Count()

IMPORT_C TInt Count ( ) const

The number of attributes in the set

ExternalizeL(RWriteStream &)

IMPORT_C void ExternalizeL ( RWriteStream & aStream ) const

Write the RAttributeSet to a stream

Parameters

RWriteStream & aStream The stream to write the attribute set to

GetValue(TInt, TDes &)

IMPORT_C TInt GetValue ( TInt aAttribute,
TDes & aValue
) const

Get the value of a specified attribute

Parameters

TInt aAttribute The attribute to query
TDes & aValue The value of the attribute is copied to this descriptor

GetValueLength(TInt)

IMPORT_C TInt GetValueLength ( TInt aAttribute ) const

Get the length of a buffer required to store the value of a specified attribute

Parameters

TInt aAttribute The attribute to query

InternalizeL(RReadStream &)

IMPORT_C void InternalizeL ( RReadStream & aStream )

Read the RAttributeSet from a stream This does not clear the contents of the attribute set before reading. The values of any attributes already in the set are updated with new values from the stream. New attributes from the stream and their values are added to the set.

Parameters

RReadStream & aStream The stream to read the attribute set from

SetValue(TInt, const TDesC &, TInt)

IMPORT_C TInt SetValue ( TInt aAttribute,
const TDesC & aValue,
TInt aErrorCode
)
Set the value of an attribute within the set
leave
KErrNotFound if the attribute is not part of the set

Parameters

TInt aAttribute The attribute to set
const TDesC & aValue The value of the attribute
TInt aErrorCode The error to return when GetValue() is called for this attribute

operator[](TInt)

IMPORT_C TInt operator[] ( TInt aIndex ) const

Find the attribute stored at a particular index in the set

Parameters

TInt aIndex The index of the attribute

Member Data Documentation

RPointerArray< CStringAttribute > iAttributes

RPointerArray < CStringAttribute > iAttributes [private]