CTypedNode Class Reference

class CTypedNode : public CNode

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 .

Inherits from

Public Member Functions
void AddAttributeL (TAttributeType, CBase *)
void AddDataAndAttributeL ( HBufC16 *, TAttributeType, CBase *)
CTypedNode < TNodeType, TAttributeType > & AppendNodeL (TNodeType)
void AppendNodeToThisNodeL ( CNode *)
CBase * Attribute (TAttributeType)
CBase * AttributeByIndex ( TInt )
CBase * AttributeByIndex ( TInt , TAttributeType &)
TInt AttributeCount ()
TBool AttributeExists (TAttributeType)
TAttributeType AttributeTypeByIndex ( TInt )
CTypedNode * Child ( TInt )
void ClearSetDataNoDeleteL ()
HBufC16 * Data ()
void DeleteAllAttributes ()
void DeleteAllChildNodes ()
void DeleteAttribute (TAttributeType)
void DeleteChildNode ( CNode *)
CTypedNode * NewL (TNodeType, CNode *)
CTypedNode * NextChild (const CNode *)
CTypedNode * NextSibling ()
TInt NumberImmediateChildren ()
CTypedNode * Parent ()
CTypedNode * PrevChild (const CNode &)
CTypedNode * PrevSibling ()
void RemoveAttributeNoDelete (TAttributeType)
void ReparentL ( CNode *)
void ResetDataPointer ( HBufC16 *)
const CTypedNode & Root ()
void SetDataL ( HBufC16 *)
void SetDataNoDeleteL ()
void SetFileDataL ( HBufC16 *)
void SetType (TNodeType)
TNodeType Type ()
Protected Member Functions
CTypedNode (TNodeType, CNode *)
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()
CNode::AddAttributeL(TAny *,CBase *)
CNode::AddDataAndAttributeL(HBufC16 *,TAny *,CBase *)
CNode::AdjustBasePointers()
CNode::AppendNodeL(TAny *)
CNode::Attribute(TAny *)const
CNode::AttributeByIndex(TInt,TAny *&)const
CNode::AttributeExists(TAny *)const
CNode::CNode(TAny *,CNode *)
CNode::DeleteAttribute(TAny *)
CNode::FindChild(const CNode *)const
CNode::NewL(TAny *,CNode *)
CNode::RemoveAttributeNoDelete(TAny *)
CNode::SetType(TAny *)
CNode::SetupDeletableOrNonDeleteableDataLC()
CNode::~CNode()
Inherited Attributes
CNode::iChildList
CNode::iDataValue
CNode::iParent
CNode::iType
CNode::iTypes
CNode::iTypesBasePtr
CNode::iValues

Constructor & Destructor Documentation

CTypedNode(TNodeType, CNode *)

CTypedNode ( TNodeType aType,
CNode * aParent
) [protected, inline]

Parameters

TNodeType aType
CNode * aParent

Member Functions Documentation

AddAttributeL(TAttributeType, CBase *)

void AddAttributeL ( TAttributeType aAttributeType,
CBase * aAttributeValue
) [inline]

Adds an attribute.

The node takes ownership of aAttributeValue.

Parameters

TAttributeType aAttributeType Attribute type
CBase * aAttributeValue Attribute value

AddDataAndAttributeL(HBufC16 *, TAttributeType, CBase *)

void AddDataAndAttributeL ( HBufC16 * aData,
TAttributeType aAttributeType,
CBase * aAttributeValue
) [inline]

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

AppendNodeL(TNodeType)

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

Creates a new child node.

Parameters

TNodeType aType Node type

AppendNodeToThisNodeL(CNode *)

void AppendNodeToThisNodeL ( CNode * aNode ) [inline]

Adds an existing node as a child.

Parameters

CNode * aNode Node to make a child

Attribute(TAttributeType)

CBase * Attribute ( TAttributeType aAttributeType ) const [inline]

Gets an attribute value for a specified attribute type.

Parameters

TAttributeType aAttributeType Attribute type

AttributeByIndex(TInt)

CBase * AttributeByIndex ( TInt aIndex ) const [inline]

Gets the attribute value of an attribute at a specified index

Parameters

TInt aIndex Attribute index

AttributeByIndex(TInt, TAttributeType &)

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

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

AttributeCount()

TInt AttributeCount ( ) const [inline]

Gets the number of attributes of this node.

AttributeExists(TAttributeType)

TBool AttributeExists ( TAttributeType aAttributeType ) const [inline]

Tests if an attribute of a specified type exists.

Parameters

TAttributeType aAttributeType Attribute type

AttributeTypeByIndex(TInt)

TAttributeType AttributeTypeByIndex ( TInt aIndex ) const [inline]

Gets the attribute value of an attribute at a specified index

Parameters

TInt aIndex Attribute index

Child(TInt)

CTypedNode * Child ( TInt aByIndex ) const [inline]

Gets a child node by index.

Parameters

TInt aByIndex Index of the child node

ClearSetDataNoDeleteL()

void ClearSetDataNoDeleteL ( ) [inline]

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

HBufC16 * Data ( ) const [inline]

Gets the node data.

DeleteAllAttributes()

void DeleteAllAttributes ( ) [inline]

Delete all node attributes.

Note that attribute values will be deleted.

DeleteAllChildNodes()

void DeleteAllChildNodes ( ) [inline]

Deletes all the child nodes of this node.

DeleteAttribute(TAttributeType)

void DeleteAttribute ( TAttributeType aAttributeType ) [inline]

Deletes an attribute of a specified type.

Note that the attribute value will be deleted.

Parameters

TAttributeType aAttributeType Attribute type

DeleteChildNode(CNode *)

void DeleteChildNode ( CNode * aNode ) [inline]

Deletes a specified child node.

Parameters

CNode * aNode Node to delete

NewL(TNodeType, CNode *)

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

Allocates and constructs a new node.

Parameters

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

NextChild(const CNode *)

CTypedNode * NextChild ( const CNode * aNode = NULL ) const [inline]

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

CTypedNode * NextSibling ( ) const [inline]

Gets the next sibling node.

This asks for the next child of its parent.

NumberImmediateChildren()

TInt NumberImmediateChildren ( ) const [inline]

Gets the number of children of this node.

Parent()

CTypedNode * Parent ( ) const [inline]

Gets the parent of this node.

PrevChild(const CNode &)

CTypedNode * PrevChild ( const CNode & aNode ) const [inline]

Gets the previous child before a specified child.

Parameters

const CNode & aNode Child node

PrevSibling()

CTypedNode * PrevSibling ( ) const [inline]

Gets the previous sibling node.

This asks for the previous child of its parent.

RemoveAttributeNoDelete(TAttributeType)

void RemoveAttributeNoDelete ( TAttributeType aAttributeType ) [inline]

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

ReparentL(CNode *)

void ReparentL ( CNode * aParent ) [inline]

Changes the parent of the node.

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

Parameters

CNode * aParent New parent

ResetDataPointer(HBufC16 *)

void ResetDataPointer ( HBufC16 * aData ) [inline]

Resets the node data to a specified pointer.

Existing data owned by the node is deleted.

Parameters

HBufC16 * aData Root node

Root()

const CTypedNode & Root ( ) const [inline]

Gets the absolute root node of the tree.

SetDataL(HBufC16 *)

void SetDataL ( HBufC16 * aDataNowNodeOwns ) [inline]

Sets the node data.

The object will delete the data in its destructor.

Parameters

HBufC16 * aDataNowNodeOwns Node data

SetDataNoDeleteL()

void SetDataNoDeleteL ( ) [inline]

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 *)

void SetFileDataL ( HBufC16 * aFileDataLocationNowNodeOwns ) [inline]

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

void SetType ( TNodeType aType ) [inline]

Sets the node type.

Parameters

TNodeType aType Node type

Type()

TNodeType Type ( ) const [inline]

Gets the node type.