Symbian
Symbian OS Library

SYMBIAN OS V9.3

[Index] [Spacer] [Previous] [Next]



Location: cnode.h
Link against: wnode.lib

Class CNode

class CNode : public CBase;

Description

Derivation

Members

Defined in CNode:
AddAttributeL(), AddDataAndAttributeL(), AppendNodeL(), AppendNodeToThisNodeL(), Attribute(), AttributeByIndex(), AttributeByIndex(), AttributeCount(), AttributeExists(), AttributeTypeByIndex(), Child(), ClearSetDataNoDeleteL(), Data(), DeleteAllAttributes(), DeleteAllChildNodes(), DeleteAttribute(), DeleteChildNode(), NewL(), NextChild(), NextSibling(), NumberImmediateChildren(), Parent(), PrevChild(), PrevSibling(), RemoveAttributeNoDelete(), ReparentL(), Reserved1(), Reserved1(), ResetDataPointer(), Root(), SetDataL(), SetDataNoDeleteL(), SetFileDataL(), SetType(), Type(), iChildList, iDataValue, iParent, iType, iTypes, iTypesBasePtr, iValues, ~CNode()

Inherited from CBase:
Delete(), Extension_(), operator new()


Construction and destruction


~CNode()

IMPORT_C ~CNode();

Description

Destructor.

Data (if owned by the object), child nodes and attributes are deleted.


NewL()

static IMPORT_C CNode *NewL(TAny *aType, CNode *aParent);

Description

Allocates and constructs a new node.

Parameters

TAny *aType

The type of the node

CNode *aParent

The parent of this node

Return value

CNode *

New node

[Top]


Member functions


DeleteChildNode()

IMPORT_C void DeleteChildNode(CNode *aNode);

Description

Deletes a specified child node.

Parameters

CNode *aNode

Node to delete


DeleteAllChildNodes()

IMPORT_C void DeleteAllChildNodes();

Description

Deletes all the child nodes of this node.


AppendNodeL()

IMPORT_C CNode &AppendNodeL(TAny *aType=0);

Description

Creates a new child node.

Parameters

TAny *aType

Node type

Return value

CNode &

The new child node


AppendNodeToThisNodeL()

IMPORT_C void AppendNodeToThisNodeL(CNode *aNode);

Description

Adds an existing node as a child.

Parameters

CNode *aNode

Node to make a child


SetDataL()

IMPORT_C void SetDataL(HBufC16 *aDataNowNodeOwns);

Description

Sets the node data.

The object will delete the data in its destructor.

Parameters

HBufC16 *aDataNowNodeOwns

Node data


Data()

IMPORT_C HBufC16 *Data() const;

Description

Gets the node data.

Return value

HBufC16 *

Node data or NULL if no data is set


SetDataNoDeleteL()

IMPORT_C void SetDataNoDeleteL();

Description

Sets the object not to delete the node data in its destructor.

Note that the function internally reallocates memory. If it leaves, the data is lost.


ClearSetDataNoDeleteL()

IMPORT_C void ClearSetDataNoDeleteL();

Description

Sets the object to delete the node data in its destructor.

Note that the function internally reallocates memory. If it leaves, the data is lost.


SetFileDataL()

IMPORT_C void SetFileDataL(HBufC16 *aFileDataLocationNowNodeOwns);

Description

Sets the node data to be taken from a specified file.

If the data is deleted, the referenced file is also deleted.

Parameters

HBufC16 *aFileDataLocationNowNodeOwns

Name of the file containing the data


ResetDataPointer()

IMPORT_C void ResetDataPointer(HBufC16 *aData);

Description

Resets the node data to a specified pointer.

Existing data owned by the node is deleted.

Parameters

HBufC16 *aData

Root node


Root()

IMPORT_C const CNode &Root() const;

Description

Gets the absolute root node of the tree.

Return value

const CNode &

Root node


Child()

IMPORT_C CNode *Child(TInt aByIndex) const;

Description

Gets a child node by index.

Parameters

TInt aByIndex

Index of the child node

Return value

CNode *

Child node


NextChild()

IMPORT_C CNode *NextChild(const CNode *aNode=0) const;

Description

Gets the first child or the next child after a specified child.

Parameters

const CNode *aNode

Child node or NULL to get the first child

Return value

CNode *

First or next child node


PrevChild()

IMPORT_C CNode *PrevChild(const CNode &aNode) const;

Description

Gets the previous child before a specified child.

Parameters

const CNode &aNode

Child node

Return value

CNode *

Previous child node


Parent()

IMPORT_C CNode *Parent() const;

Description

Gets the parent of this node.

Return value

CNode *

Parent


ReparentL()

IMPORT_C void ReparentL(CNode *aParent);

Description

Changes the parent of the node.

The node is removed from the childlist of its current parent.

Parameters

CNode *aParent

New parent


NextSibling()

IMPORT_C CNode *NextSibling() const;

Description

Gets the next sibling node.

This asks for the next child of its parent.

Return value

CNode *

Next sibling node


PrevSibling()

IMPORT_C CNode *PrevSibling() const;

Description

Gets the previous sibling node.

This asks for the previous child of its parent.

Return value

CNode *

Previous sibling node


NumberImmediateChildren()

IMPORT_C TInt NumberImmediateChildren() const;

Description

Gets the number of children of this node.

Return value

TInt

Number of children of this node


DeleteAttribute()

IMPORT_C void DeleteAttribute(TAny *aAttributeType);

Description

Deletes an attribute of a specified type.

Note that the attribute value will be deleted.

Parameters

TAny *aAttributeType

Attribute type


DeleteAllAttributes()

IMPORT_C void DeleteAllAttributes();

Description

Delete all node attributes.

Note that attribute values will be deleted.


RemoveAttributeNoDelete()

IMPORT_C void RemoveAttributeNoDelete(TAny *aAttributeType);

Description

Removes an attribute of a specified type, but does not delete it.

The caller is now responsible for the destruction of the attribute value.

Parameters

TAny *aAttributeType

Attribute type


AttributeCount()

IMPORT_C TInt AttributeCount() const;

Description

Gets the number of attributes of this node.

Return value

TInt

Number of attributes of this node


AttributeTypeByIndex()

IMPORT_C TAny *AttributeTypeByIndex(TInt aIndex) const;

Description

Gets the attribute value of an attribute at a specified index

Parameters

TInt aIndex

Attribute index

Return value

TAny *

Attribute value


AttributeByIndex()

IMPORT_C CBase *AttributeByIndex(TInt aIndex) const;

Description

Gets the attribute value of an attribute at a specified index.

Parameters

TInt aIndex

Attribute index

Return value

CBase *

Attribute value


AttributeByIndex()

IMPORT_C CBase *AttributeByIndex(TInt aIndex, TAny *&aType) const;

Description

Gets the attribute value and type of an attribute at a specified index..

Parameters

TInt aIndex

Attribute index

TAny *&aType

On return, the attribute type

Return value

CBase *

Attribute value


AddAttributeL()

IMPORT_C void AddAttributeL(TAny *AttributeType, CBase *aAttributeValue);

Description

Adds an attribute.

The node takes ownership of aAttributeValue.

Parameters

TAny *AttributeType

Attribute type

CBase *aAttributeValue

Attribute value


AddDataAndAttributeL()

IMPORT_C void AddDataAndAttributeL(HBufC16 *aData, TAny *AttributeType, CBase *aAttributeValue);

Description

Sets node data and adds an attribute.

The node takes ownership of aDataand aAttributeValue. Existing node data owned by the node is deleted.

Parameters

HBufC16 *aData

Node data

TAny *AttributeType

Attribute type

CBase *aAttributeValue

Attribute value


Attribute()

IMPORT_C CBase *Attribute(TAny *AttributeType) const;

Description

Gets an attribute value for a specified attribute type.

Parameters

TAny *AttributeType

Attribute type

Return value

CBase *

Attribute value


AttributeExists()

IMPORT_C TBool AttributeExists(TAny *aAttributeType) const;

Description

Tests if an attribute of a specified type exists.

Parameters

TAny *aAttributeType

Attribute type

Return value

TBool

True if the attribute exists, otherwise false


Type()

IMPORT_C TAny *Type() const;

Description

Gets the node type.

Return value

TAny *

Node type


SetType()

IMPORT_C void SetType(TAny *aType);

Description

Sets the node type.

Parameters

TAny *aType

Node type


Reserved1()

private: virtual void Reserved1();

Description


Reserved1()

private: virtual void Reserved1() const;

Description

[Top]


Member data


iType

protected: TAny * iType;

Description


iParent

protected: CNode * iParent;

Description


iValues

protected: CArrayPtrFlat< CBase > iValues;

Description


iTypes

protected: CArrayPtrFlat< TAny > iTypes;

Description


iTypesBasePtr

protected: TInt32 * iTypesBasePtr;

Description


iDataValue

protected: CDataNoDelete * iDataValue;

Description


iChildList

protected: CArrayPtr< CNode > * iChildList;

Description