Symbian
Symbian Developer Library

SYMBIAN OS V9.4

Feedback

[Index] [Previous] [Next]

#include <cnode.h>

Class CTypedNode

class CTypedNode : public CNode;

Description

Template class for a node in a node tree.

The node type is set to the template parameter TNodeType and the attribute type to TAttributeType. These parameters should be pointers to the type required to store the type value: e.g. for a string, a const TDesC*.

The class is thin template over CNode.

Derivation

Members

Defined in CTypedNode:

Inherited from CBase:

Inherited from CNode:


Construction and destruction


NewL(TNodeType,CNode *)

static inline CTypedNode* NewL(TNodeType aType, CNode *aParent);

Description

Allocates and constructs a new node.

Parameters

TNodeType aType

The type of the node

CNode *aParent

The parent of this node

Return value

CTypedNode *

New node


CTypedNode(TNodeType,CNode *)

protected: inline CTypedNode(TNodeType aType, CNode *aParent);

Description

Parameters

TNodeType aType

CNode *aParent

[Top]


Member functions


DeleteChildNode(CNode *)

inline void DeleteChildNode(CNode *aNode);

Description

Deletes a specified child node.

Parameters

CNode *aNode

Node to delete


DeleteAllChildNodes()

inline void DeleteAllChildNodes();

Description

Deletes all the child nodes of this node.


AppendNodeL(TNodeType)

inline CTypedNode< TNodeType, TAttributeType >& AppendNodeL(TNodeType aType);

Description

Creates a new child node.

Parameters

TNodeType aType

Node type

Return value

CTypedNode< TNodeType, TAttributeType > &

The new child node


AppendNodeToThisNodeL(CNode *)

inline void AppendNodeToThisNodeL(CNode *aNode);

Description

Adds an existing node as a child.

Parameters

CNode *aNode

Node to make a child


SetDataL(HBufC16 *)

inline void SetDataL(HBufC16 *aDataNowNodeOwns);

Description

Sets the node data.

The object will delete the data in its destructor.

Parameters

HBufC16 *aDataNowNodeOwns

Node data


SetDataNoDeleteL()

inline 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()

inline 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(HBufC16 *)

inline 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(HBufC16 *)

inline 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


Data()const

inline HBufC16* Data() const;

Description

Gets the node data.

Return value

HBufC16 *

Node data or NULL if no data is set


Root()const

inline const CTypedNode& Root() const;

Description

Gets the absolute root node of the tree.

Return value

const CTypedNode &

Root node


Child(TInt)const

inline CTypedNode* Child(TInt aByIndex) const;

Description

Gets a child node by index.

Parameters

TInt aByIndex

Index of the child node

Return value

CTypedNode *

Child node


NextChild(const CNode *)const

inline CTypedNode* 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

CTypedNode *

First or next child node


PrevChild(const CNode &)const

inline CTypedNode* PrevChild(const CNode &aNode) const;

Description

Gets the previous child before a specified child.

Parameters

const CNode &aNode

Child node

Return value

CTypedNode *

Previous child node


Parent()const

inline CTypedNode* Parent() const;

Description

Gets the parent of this node.

Return value

CTypedNode *

Parent


ReparentL(CNode *)

inline 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()const

inline CTypedNode* NextSibling() const;

Description

Gets the next sibling node.

This asks for the next child of its parent.

Return value

CTypedNode *

Next sibling node


PrevSibling()const

inline CTypedNode* PrevSibling() const;

Description

Gets the previous sibling node.

This asks for the previous child of its parent.

Return value

CTypedNode *

Previous sibling node


NumberImmediateChildren()const

inline TInt NumberImmediateChildren() const;

Description

Gets the number of children of this node.

Return value

TInt

Number of children of this node


DeleteAttribute(TAttributeType)

inline void DeleteAttribute(TAttributeType aAttributeType);

Description

Deletes an attribute of a specified type.

Note that the attribute value will be deleted.

Parameters

TAttributeType aAttributeType

Attribute type


DeleteAllAttributes()

inline void DeleteAllAttributes();

Description

Delete all node attributes.

Note that attribute values will be deleted.


RemoveAttributeNoDelete(TAttributeType)

inline void RemoveAttributeNoDelete(TAttributeType 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

TAttributeType aAttributeType

Attribute type


AttributeCount()const

inline TInt AttributeCount() const;

Description

Gets the number of attributes of this node.

Return value

TInt

Number of attributes of this node


AttributeTypeByIndex(TInt)const

inline TAttributeType AttributeTypeByIndex(TInt aIndex) const;

Description

Gets the attribute value of an attribute at a specified index

Parameters

TInt aIndex

Attribute index

Return value

TAttributeType

Attribute value


AttributeByIndex(TInt)const

inline 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(TInt,TAttributeType &)const

inline CBase* AttributeByIndex(TInt aIndex, TAttributeType &aType) const;

Description

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

Parameters

TInt aIndex

Attribute index

TAttributeType &aType

On return, the attribute type

Return value

CBase *

Attribute value


AddAttributeL(TAttributeType,CBase *)

inline void AddAttributeL(TAttributeType aAttributeType, CBase *aAttributeValue);

Description

Adds an attribute.

The node takes ownership of aAttributeValue.

Parameters

TAttributeType aAttributeType

Attribute type

CBase *aAttributeValue

Attribute value


AddDataAndAttributeL(HBufC16 *,TAttributeType,CBase *)

inline void AddDataAndAttributeL(HBufC16 *aData, TAttributeType aAttributeType, 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

TAttributeType aAttributeType

Attribute type

CBase *aAttributeValue

Attribute value


Attribute(TAttributeType)const

inline CBase* Attribute(TAttributeType aAttributeType) const;

Description

Gets an attribute value for a specified attribute type.

Parameters

TAttributeType aAttributeType

Attribute type

Return value

CBase *

Attribute value


AttributeExists(TAttributeType)const

inline TBool AttributeExists(TAttributeType aAttributeType) const;

Description

Tests if an attribute of a specified type exists.

Parameters

TAttributeType aAttributeType

Attribute type

Return value

TBool

True if the attribute exists, otherwise false


Type()const

inline TNodeType Type() const;

Description

Gets the node type.

Return value

TNodeType

Node type


SetType(TNodeType)

inline void SetType(TNodeType aType);

Description

Sets the node type.

Parameters

TNodeType aType

Node type