ContentAccess::RAttributeSet Class Reference

class ContentAccess::RAttributeSet

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

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
RAttributeSet()
IMPORT_C voidAddL(TInt)
IMPORT_C voidClose()
IMPORT_C TIntCount()
IMPORT_C voidExternalizeL(RWriteStream &)
IMPORT_C TIntGetValue(TInt, TInt &)
IMPORT_C voidInternalizeL(RReadStream &)
IMPORT_C TIntSetValue(TInt, TInt, TInt)
IMPORT_C TIntoperator[](TInt)
Private Member Functions
voidAddL(TInt, TInt, TInt)
Private Attributes
RArray< TAttributeValue >iAttributes

Constructor & Destructor Documentation

RAttributeSet()

IMPORT_CRAttributeSet()

Member Functions Documentation

AddL(TInt)

IMPORT_C voidAddL(TIntaAttribute)

Add a new attribute to the set The attribute is initalised with a default value of EAttributeNotSupported

Parameters

TInt aAttributeThe attribute to add to the set

AddL(TInt, TInt, TInt)

voidAddL(TIntaAttribute,
TIntaValue,
TIntaErrorCode
)[private]

Parameters

TInt aAttribute
TInt aValue
TInt aErrorCode

Close()

IMPORT_C voidClose()

Release all resources used by the RAttributeSet

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

Count()

IMPORT_C TIntCount()const

The number of attributes in the set The number of attributes in the set

ExternalizeL(RWriteStream &)

IMPORT_C voidExternalizeL(RWriteStream &aStream)const

Write the RAttributeSet to a stream

Parameters

RWriteStream & aStreamThe stream to write the attribute set to

GetValue(TInt, TInt &)

IMPORT_C TIntGetValue(TIntaAttribute,
TInt &aValue
)const

Get the value of a specified attribute Whether the value parameter was updated

KErrNone The attribute value was updated

KErrNotFound The attribute is not part of the set

Parameters

TInt aAttributeThe attribute to query
TInt & aValueThe value of the attribute

InternalizeL(RReadStream &)

IMPORT_C voidInternalizeL(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 & aStreamThe stream to read the attribute set from

SetValue(TInt, TInt, TInt)

IMPORT_C TIntSetValue(TIntaAttribute,
TIntaValue,
TIntaErrorCode
)

Set the value of an attribute within the set Whether the new attribute value was set

KErrNone if the value was set

KErrNotFound if the attribute is not part of the set

Parameters

TInt aAttributeThe attribute to set
TInt aValueThe value of the attribute
TInt aErrorCodeThe error code to return when this attribute is requested via the GetValue() function

operator[](TInt)

IMPORT_C TIntoperator[](TIntaIndex)const

Find the attribute stored at a particular index in the set The attribute, NOT the value of the attribute

Parameters

TInt aIndexThe index of the attribute

Member Data Documentation

RArray< TAttributeValue > iAttributes

RArray< TAttributeValue >iAttributes[private]