ContentAccess::RStringAttributeSet Class Reference

#include <caf/stringattributeset.h>

Link against: cafutils.lib

class ContentAccess::RStringAttributeSet
Public Member Functions
RStringAttributeSet()
IMPORT_C voidAddL(TInt)
IMPORT_C voidClose()
IMPORT_C TIntCount()
IMPORT_C voidExternalizeL(RWriteStream &)
IMPORT_C TIntGetValue(TInt, TDes &)
IMPORT_C TIntGetValueLength(TInt)
IMPORT_C voidInternalizeL(RReadStream &)
IMPORT_C TIntSetValue(TInt, const TDesC &, TInt)
IMPORT_C TIntoperator[](TInt)

Detailed Description

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

Constructor & Destructor Documentation

RStringAttributeSet ( )

IMPORT_CRStringAttributeSet()

Member Function Documentation

AddL ( TInt )

IMPORT_C voidAddL(TIntaAttribute)

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

ParameterDescription
aAttributeThe attribute to add to the set

Close ( )

IMPORT_C voidClose()

Release all resources used by the RStringAttributeSet

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

Count ( )

IMPORT_C TIntCount()const

The number of attributes in the set

Returns: The number of attributes in the set

ExternalizeL ( RWriteStream & )

IMPORT_C voidExternalizeL(RWriteStream &aStream)const

Write the RAttributeSet to a stream

ParameterDescription
aStreamThe stream to write the attribute set to

GetValue ( TInt, TDes & )

IMPORT_C TIntGetValue(TIntaAttribute,
TDes &aValue
)const

Get the value of a specified attribute

ParameterDescription
aAttributeThe attribute to query
aValueThe value of the attribute is copied to this descriptor

Returns: The value of the attribute KErrOverflow If the descriptor is not large enough to store the attribute KErrNotFound if the attribute is not part of the set

GetValueLength ( TInt )

IMPORT_C TIntGetValueLength(TIntaAttribute)const

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

ParameterDescription
aAttributeThe attribute to query

Returns: The length of the 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.

ParameterDescription
aStreamThe stream to read the attribute set from

SetValue ( TInt, const TDesC &, TInt )

IMPORT_C TIntSetValue(TIntaAttribute,
const TDesC &aValue,
TIntaErrorCode
)
Set the value of an attribute within the set
leave
KErrNotFound if the attribute is not part of the set
ParameterDescription
aAttributeThe attribute to set
aValueThe value of the attribute
aErrorCodeThe error to return when GetValue() is called for this attribute

operator[] ( TInt )

IMPORT_C TIntoperator[](TIntaIndex)const

Find the attribute stored at a particular index in the set

ParameterDescription
aIndexThe index of the attribute

Returns: The attribute, NOT the value of the attribute