Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

[Index] [Glossary] [Previous] [Next]



Location: vprop.h
Link against: versit.lib

Class CParserProperty

CParserProperty

Support

Supported from 5.0

Description

A property in a vCard or vCalendar. Has a name, a value and, optionally, one or more parameters, which are all initialised on construction. Grouped properties are supported — see the derived class, CParserGroupedProperty.

Versit properties have the general form:

Property Name (; Property Parameter Name(=Property Parameter Value))* : Property Value

where items in brackets are optional and * indicates that the item may be repeated

e.g. TEL; HOME; ENCODING=QUOTED-PRINTABLE; CHARSET=US-ASCII : 01234 567890

Here, TEL is the property name, HOME, ENCODING and CHARSET are property parameter names and QUOTED-PRINTABLE and US-ASCII are property parameter values. The component following the colon is the property value.

Derivation

CBaseBase class for all classes to be instantiated on the heap
CParserPropertyA property in a vCard or vCalendar

Defined in CParserProperty:
AddParamL(), DeleteParam(), Name(), NewL(), NewLC(), Param(), SetNameL(), Value(), ~CParserProperty()

Inherited from CBase:
operator new()


Construction and destruction


NewL()

CParserProperty* NewL(CParserPropertyValue* aPropertyValue, const TDesC& aName, CArrayPtr<CParserParam>* aArrayOfParams);

Description

Allocates and constructs a new vCalendar or vCard property with the property value, property name and array of property parameters specified.

Parameters

CParserPropertyValue* aPropertyValue

Pointer to the property value.

const TDesC& aName

The property name.

CArrayPtr<CParserParam>* aArrayOfParams

Pointer to the property parameters. The property takes ownership of the array of parameters. May be NULL.

Return value

CParserProperty*

Pointer to the newly created property.


NewLC()

CParserProperty* NewLC(CParserPropertyValue* aPropertyValue, const TDesC& aName, CArrayPtr<CParserParam>* aArrayOfParams);

Description

Allocates and constructs a new vCalendar or vCard property with the property value, property name and array of property parameters specified — leaving the property on the cleanup stack.

Parameters

CParserPropertyValue* aPropertyValue

Pointer to the property value.

const TDesC& aName

The property name.

CArrayPtr<CParserParam>* aArrayOfParams

Pointer to the property parameters. The property object takes ownership of the array of parameters. May be NULL.

Return value

CParserProperty*

Pointer to the newly created property.


~CParserProperty()

~CParserProperty();

Description

Frees all resources owned by the property, prior to its destruction.

[Top]


Property name


Name()

TPtrC Name() const;

Description

Gets the property name. If no name has been set, the function returns an empty descriptor.

Return value

TPtrC

The property name.


SetNameL()

void SetNameL(const TDesC& aName);

Description

Sets the property name. If a name has already been set, this function will replace it.

Parameters

const TDesC& aName

The new property name.

Leave codes

 

This function allocates and constructs a new HBufC descriptor on the heap and initialises it using the content of aName , so can leave if insufficient memory is available. Property names are defined in file vtoken.h.

[Top]


Property parameters


AddParamL()

void AddParamL(CParserParam* aParam);

Description

Adds a property parameter to the property. Any existing parameter with the same name is replaced. The parameter is appended to the property's parameter array. If no property parameter array has been allocated, the function will first allocate one.

Parameters

CParserParam* aParam

Pointer to a generic property parameter, consisting of a name and optionally a value, both specified as descriptors. The property takes ownership of the new parameter.


DeleteParam()

void DeleteParam(TDesC& aParamName);

Description

Deletes the specified property parameter from the property's array of parameters, if it exists in the array.

Parameters

TDesC& aParamName

The name of the parameter to delete.


Param()

CParserParam* Param(const TDesC& aParamName) const;

Description

Gets a pointer to the property parameter with the specified name. If the property has more than one parameter with the same name, the function returns the first one found.

Parameters

const TDesC& aParamName

The name of the parameter to search for.

Return value

CParserParam*

Pointer to a property parameter. NULL if the parameter name specified is not found in the array.

[Top]


Property value


Value()

CParserPropertyValue* Value() const;

Description

Gets a pointer to the property value.

Return value

CParserPropertyValue*

Pointer to generic parser property value.