EPOC   SDK Home Glossary Indexes Previous Next Up

CParserProperty class


Contents


CParserProperty class — Versit property

Section Contents


Overview

Derivation

CBase

Abstract: CBase behaviour.

Defined in

vprop.h

Link against

versit.lib

Description

Represents a versit property. Stores the property name, the property value and, optionally, one or more property parameters. Derived classes are identified by a UID, specified in the CParserPropertyValue passed to the NewL() function. Grouped properties are supported by 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.


Construction and destruction


NewL() — Allocate and construct

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

Description

Use this function to allocate and construct a new versit property from the value, name and property parameter array specified.

Arguments

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.

NULL if the property has no parameters.

Return value

CParserProperty*

Pointer to the newly created property.


NewLC() — Allocate and construct

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

Description

Use this function to allocate and construct a new versit property from the value, name and property parameter array specified. The property is left on the cleanup stack.

Arguments

CParserPropertyValue* aPropertyValue

Pointer to the property value.

const TDesC& aName

The property name.

CArrayPtr<CParserParam>* aArrayOfParams

Pointer to the property parameters.

The parser property object takes ownership of the array of parameters.

NULL if the property has no parameters.

Return value

CParserProperty*

Pointer to the newly created parser property.


~CParserProperty() — Destructor

~CParserProperty();

Description

The destructor frees all resources owned by the property, prior to its destruction.


Property name


Name() — Get name

TPtrC Name() const;

Description

Use this function to retrieve the property name.

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

Return value

TPtrC

The property name.


SetNameL() — Set name

void SetNameL(const TDesC& aName);

Description

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

Arguments

const TDesC& aName

The new property name.

Leave considerations

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.


Parameters


AddParamL() — Add a parameter

void AddParamL(CParserParam* aParam);

Description

Use this function to add 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.

Arguments

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() — Delete a parameter

void DeleteParam(TDesC& aParamName);

Description

Use this function to delete the specified property parameter from the property's array of parameters, if it exists in the array.

Arguments

TDesC& aParamName

The name of the parameter to delete.


Param() — Get parameter

CParserParam* Param(const TDesC& aParamName) const;

Description

Use this function to retrieve a pointer to the property parameter with the specified name.

Arguments

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.


Property value


Value() — Get the property value

CParserPropertyValue* Value() const;

Description

Use this function to retrieve a pointer to the property value.

Return value

CParserPropertyValue*

Pointer to generic parser property value.

EPOC       SDK Home Glossary Indexes Previous Next Up