CNode Class Reference

class CNode : public CBase

Inherits from

Public Member Functions
~CNode ()
IMPORT_C void AddAttributeL ( TAny *, CBase *)
IMPORT_C void AddDataAndAttributeL ( HBufC16 *, TAny *, CBase *)
IMPORT_C CNode & AppendNodeL ( TAny *)
IMPORT_C void AppendNodeToThisNodeL ( CNode *)
IMPORT_C CBase * Attribute ( TAny *)
IMPORT_C CBase * AttributeByIndex ( TInt )
IMPORT_C CBase * AttributeByIndex ( TInt , TAny *&)
IMPORT_C TInt AttributeCount ()
IMPORT_C TBool AttributeExists ( TAny *)
IMPORT_C TAny * AttributeTypeByIndex ( TInt )
IMPORT_C CNode * Child ( TInt )
IMPORT_C void ClearSetDataNoDeleteL ()
IMPORT_C HBufC16 * Data ()
IMPORT_C void DeleteAllAttributes ()
IMPORT_C void DeleteAllChildNodes ()
IMPORT_C void DeleteAttribute ( TAny *)
IMPORT_C void DeleteChildNode ( CNode *)
IMPORT_C CNode * NewL ( TAny *, CNode *)
IMPORT_C CNode * NextChild (const CNode *)
IMPORT_C CNode * NextSibling ()
IMPORT_C TInt NumberImmediateChildren ()
IMPORT_C CNode * Parent ()
IMPORT_C CNode * PrevChild (const CNode &)
IMPORT_C CNode * PrevSibling ()
IMPORT_C void RemoveAttributeNoDelete ( TAny *)
IMPORT_C void ReparentL ( CNode *)
IMPORT_C void ResetDataPointer ( HBufC16 *)
IMPORT_C const CNode & Root ()
IMPORT_C void SetDataL ( HBufC16 *)
IMPORT_C void SetDataNoDeleteL ()
IMPORT_C void SetFileDataL ( HBufC16 *)
IMPORT_C void SetType ( TAny *)
IMPORT_C TAny * Type ()
Protected Member Functions
CNode ( TAny *, CNode *)
void AdjustBasePointers ()
TInt FindChild (const CNode *)
HBufC16 * SetupDeletableOrNonDeleteableDataLC ()
Private Member Functions
void Reserved1 ()
void Reserved1 ()
Inherited Functions
CBase::CBase()
CBase::Delete(CBase *)
CBase::Extension_(TUint,TAny *&,TAny *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
Protected Attributes
CArrayPtr < CNode > * iChildList
CDataNoDelete * iDataValue
CNode * iParent
TAny * iType
CArrayPtrFlat < TAny > iTypes
TInt32 * iTypesBasePtr
CArrayPtrFlat < CBase > iValues
Private Attributes
TAny * iReserved

Constructor & Destructor Documentation

CNode(TAny *, CNode *)

CNode ( TAny * aType,
CNode * aParent
) [protected]

Parameters

TAny * aType
CNode * aParent

~CNode()

IMPORT_C ~CNode ( )

Destructor.

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

Member Functions Documentation

AddAttributeL(TAny *, CBase *)

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

Adds an attribute.

The node takes ownership of aAttributeValue.

Parameters

TAny * AttributeType Attribute type
CBase * aAttributeValue Attribute value

AddDataAndAttributeL(HBufC16 *, TAny *, CBase *)

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

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

AdjustBasePointers()

void AdjustBasePointers ( ) [protected]

AppendNodeL(TAny *)

IMPORT_C CNode & AppendNodeL ( TAny * aType = 0 )

Creates a new child node.

Parameters

TAny * aType = 0 Node type

AppendNodeToThisNodeL(CNode *)

IMPORT_C void AppendNodeToThisNodeL ( CNode * aNode )

Adds an existing node as a child.

Parameters

CNode * aNode Node to make a child

Attribute(TAny *)

IMPORT_C CBase * Attribute ( TAny * AttributeType ) const

Gets an attribute value for a specified attribute type.

Parameters

TAny * AttributeType Attribute type

AttributeByIndex(TInt)

IMPORT_C CBase * AttributeByIndex ( TInt aIndex ) const

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

Parameters

TInt aIndex Attribute index

AttributeByIndex(TInt, TAny *&)

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

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

AttributeCount()

IMPORT_C TInt AttributeCount ( ) const

Gets the number of attributes of this node.

AttributeExists(TAny *)

IMPORT_C TBool AttributeExists ( TAny * aAttributeType ) const

Tests if an attribute of a specified type exists.

Parameters

TAny * aAttributeType Attribute type

AttributeTypeByIndex(TInt)

IMPORT_C TAny * AttributeTypeByIndex ( TInt aIndex ) const

Gets the attribute value of an attribute at a specified index

Parameters

TInt aIndex Attribute index

Child(TInt)

IMPORT_C CNode * Child ( TInt aByIndex ) const

Gets a child node by index.

Parameters

TInt aByIndex Index of the child node

ClearSetDataNoDeleteL()

IMPORT_C void ClearSetDataNoDeleteL ( )

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.

Data()

IMPORT_C HBufC16 * Data ( ) const

Gets the node data.

DeleteAllAttributes()

IMPORT_C void DeleteAllAttributes ( )

Delete all node attributes.

Note that attribute values will be deleted.

DeleteAllChildNodes()

IMPORT_C void DeleteAllChildNodes ( )

Deletes all the child nodes of this node.

DeleteAttribute(TAny *)

IMPORT_C void DeleteAttribute ( TAny * aAttributeType )

Deletes an attribute of a specified type.

Note that the attribute value will be deleted.

Parameters

TAny * aAttributeType Attribute type

DeleteChildNode(CNode *)

IMPORT_C void DeleteChildNode ( CNode * aNode )

Deletes a specified child node.

Parameters

CNode * aNode Node to delete

FindChild(const CNode *)

TInt FindChild ( const CNode * aNode ) const [protected]

Parameters

const CNode * aNode

NewL(TAny *, CNode *)

IMPORT_C CNode * NewL ( TAny * aType,
CNode * aParent
) [static]

Allocates and constructs a new node.

Parameters

TAny * aType The type of the node
CNode * aParent The parent of this node

NextChild(const CNode *)

IMPORT_C CNode * NextChild ( const CNode * aNode = NULL ) const

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

Parameters

const CNode * aNode = NULL Child node or NULL to get the first child

NextSibling()

IMPORT_C CNode * NextSibling ( ) const

Gets the next sibling node.

This asks for the next child of its parent.

NumberImmediateChildren()

IMPORT_C TInt NumberImmediateChildren ( ) const

Gets the number of children of this node.

Parent()

IMPORT_C CNode * Parent ( ) const

Gets the parent of this node.

PrevChild(const CNode &)

IMPORT_C CNode * PrevChild ( const CNode & aNode ) const

Gets the previous child before a specified child.

Parameters

const CNode & aNode Child node

PrevSibling()

IMPORT_C CNode * PrevSibling ( ) const

Gets the previous sibling node.

This asks for the previous child of its parent.

RemoveAttributeNoDelete(TAny *)

IMPORT_C void RemoveAttributeNoDelete ( TAny * aAttributeType )

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

ReparentL(CNode *)

IMPORT_C void ReparentL ( CNode * aParent )

Changes the parent of the node.

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

Parameters

CNode * aParent New parent

Reserved1()

void Reserved1 ( ) [private, virtual]

Reserved1()

void Reserved1 ( ) const [private, virtual]

ResetDataPointer(HBufC16 *)

IMPORT_C void ResetDataPointer ( HBufC16 * aData )

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

Gets the absolute root node of the tree.

SetDataL(HBufC16 *)

IMPORT_C void SetDataL ( HBufC16 * aDataNowNodeOwns )

Sets the node data.

The object will delete the data in its destructor.

Parameters

HBufC16 * aDataNowNodeOwns Node data

SetDataNoDeleteL()

IMPORT_C void SetDataNoDeleteL ( )

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.

SetFileDataL(HBufC16 *)

IMPORT_C void SetFileDataL ( HBufC16 * aFileDataLocationNowNodeOwns )

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

SetType(TAny *)

IMPORT_C void SetType ( TAny * aType )

Sets the node type.

Parameters

TAny * aType Node type

SetupDeletableOrNonDeleteableDataLC()

HBufC16 * SetupDeletableOrNonDeleteableDataLC ( ) [protected]

Type()

IMPORT_C TAny * Type ( ) const

Gets the node type.

Member Data Documentation

CArrayPtr< CNode > * iChildList

CArrayPtr < CNode > * iChildList [protected]

CDataNoDelete * iDataValue

CDataNoDelete * iDataValue [protected]

CNode * iParent

CNode * iParent [protected]

TAny * iReserved

TAny * iReserved [private]

TAny * iType

TAny * iType [protected]

CArrayPtrFlat< TAny > iTypes

CArrayPtrFlat < TAny > iTypes [protected]

TInt32 * iTypesBasePtr

TInt32 * iTypesBasePtr [protected]

CArrayPtrFlat< CBase > iValues

CArrayPtrFlat < CBase > iValues [protected]