CTypedNode Class Reference

#include <mw/cnode.h>

Link against: xmlelemt.lib

class CTypedNode : public CNode

Inherits from

Public Member Functions
voidAddAttributeL(TAttributeType, CBase *)
voidAddDataAndAttributeL(HBufC16 *, TAttributeType, CBase *)
CTypedNode< TNodeType, TAttributeType > &AppendNodeL(TNodeType)
voidAppendNodeToThisNodeL(CNode *)
CBase *Attribute(TAttributeType)
CBase *AttributeByIndex(TInt)
CBase *AttributeByIndex(TInt, TAttributeType &)
TInt AttributeCount()
TBool AttributeExists(TAttributeType)
TAttributeTypeAttributeTypeByIndex(TInt)
CTypedNode *Child(TInt)
voidClearSetDataNoDeleteL()
HBufC16 *Data()
voidDeleteAllAttributes()
voidDeleteAllChildNodes()
voidDeleteAttribute(TAttributeType)
voidDeleteChildNode(CNode *)
CTypedNode *NewL(TNodeType, CNode *)
CTypedNode *NextChild(const CNode *)
CTypedNode *NextSibling()
TInt NumberImmediateChildren()
CTypedNode *Parent()
CTypedNode *PrevChild(const CNode &)
CTypedNode *PrevSibling()
voidRemoveAttributeNoDelete(TAttributeType)
voidReparentL(CNode *)
voidResetDataPointer(HBufC16 *)
const CTypedNode &Root()
voidSetDataL(HBufC16 *)
voidSetDataNoDeleteL()
voidSetFileDataL(HBufC16 *)
voidSetType(TNodeType)
TNodeTypeType()
Protected Member Functions
CTypedNode(TNodeType, CNode *)
Inherited Attributes
CNode::iChildList
CNode::iDataValue
CNode::iParent
CNode::iType
CNode::iTypes
CNode::iTypesBasePtr
CNode::iValues
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()

Detailed 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.

Constructor & Destructor Documentation

CTypedNode ( TNodeType, CNode * )

CTypedNode(TNodeTypeaType,
CNode *aParent
)[protected, inline]

Member Function Documentation

AddAttributeL ( TAttributeType, CBase * )

voidAddAttributeL(TAttributeTypeaAttributeType,
CBase *aAttributeValue
)[inline]

Adds an attribute.

The node takes ownership of aAttributeValue.

ParameterDescription
aAttributeTypeAttribute type
aAttributeValueAttribute value

AddDataAndAttributeL ( HBufC16 *, TAttributeType, CBase * )

voidAddDataAndAttributeL(HBufC16 *aData,
TAttributeTypeaAttributeType,
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.

ParameterDescription
aDataNode data
aAttributeTypeAttribute type
aAttributeValueAttribute value

AppendNodeL ( TNodeType )

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

Creates a new child node.

ParameterDescription
aTypeNode type

Returns: The new child node

AppendNodeToThisNodeL ( CNode * )

voidAppendNodeToThisNodeL(CNode *aNode)[inline]

Adds an existing node as a child.

ParameterDescription
aNodeNode to make a child

Attribute ( TAttributeType )

CBase *Attribute(TAttributeTypeaAttributeType)const [inline]

Gets an attribute value for a specified attribute type.

ParameterDescription
aAttributeTypeAttribute type

Returns: Attribute value

AttributeByIndex ( TInt )

CBase *AttributeByIndex(TIntaIndex)const [inline]

Gets the attribute value of an attribute at a specified index

ParameterDescription
aIndexAttribute index

Returns: Attribute value

AttributeByIndex ( TInt, TAttributeType & )

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

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

ParameterDescription
aIndexAttribute index
aTypeOn return, the attribute type

Returns: Attribute value

AttributeCount ( )

TInt AttributeCount()const [inline]

Reimplemented from CNode::AttributeCount()const

Gets the number of attributes of this node.

Returns: Number of attributes of this node

AttributeExists ( TAttributeType )

TBool AttributeExists(TAttributeTypeaAttributeType)const [inline]

Tests if an attribute of a specified type exists.

ParameterDescription
aAttributeTypeAttribute type

Returns: True if the attribute exists, otherwise false

AttributeTypeByIndex ( TInt )

TAttributeTypeAttributeTypeByIndex(TIntaIndex)const [inline]

Gets the attribute value of an attribute at a specified index

ParameterDescription
aIndexAttribute index

Returns: Attribute value

Child ( TInt )

CTypedNode *Child(TIntaByIndex)const [inline]

Reimplemented from CNode::Child(TInt)const

Gets a child node by index.

ParameterDescription
aByIndexIndex of the child node

Returns: Child node

ClearSetDataNoDeleteL ( )

voidClearSetDataNoDeleteL()[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]

Reimplemented from CNode::Data()const

Gets the node data.

Returns: Node data or NULL if no data is set

DeleteAllAttributes ( )

voidDeleteAllAttributes()[inline]

Reimplemented from CNode::DeleteAllAttributes()

Delete all node attributes.

Note that attribute values will be deleted.

DeleteAllChildNodes ( )

voidDeleteAllChildNodes()[inline]

Reimplemented from CNode::DeleteAllChildNodes()

Deletes all the child nodes of this node.

DeleteAttribute ( TAttributeType )

voidDeleteAttribute(TAttributeTypeaAttributeType)[inline]

Deletes an attribute of a specified type.

Note that the attribute value will be deleted.

ParameterDescription
aAttributeTypeAttribute type

DeleteChildNode ( CNode * )

voidDeleteChildNode(CNode *aNode)[inline]

Deletes a specified child node.

ParameterDescription
aNodeNode to delete

NewL ( TNodeType, CNode * )

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

Allocates and constructs a new node.

ParameterDescription
aTypeThe type of the node
aParentThe parent of this node

Returns: New node

NextChild ( const CNode * )

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

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

ParameterDescription
aNodeChild node or NULL to get the first child

Returns: First or next child node

NextSibling ( )

CTypedNode *NextSibling()const [inline]

Reimplemented from CNode::NextSibling()const

Gets the next sibling node.

This asks for the next child of its parent.

Returns: Next sibling node

NumberImmediateChildren ( )

TInt NumberImmediateChildren()const [inline]

Gets the number of children of this node.

Returns: Number of children of this node

Parent ( )

CTypedNode *Parent()const [inline]

Reimplemented from CNode::Parent()const

Gets the parent of this node.

Returns: Parent

PrevChild ( const CNode & )

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

Gets the previous child before a specified child.

ParameterDescription
aNodeChild node

Returns: Previous child node

PrevSibling ( )

CTypedNode *PrevSibling()const [inline]

Reimplemented from CNode::PrevSibling()const

Gets the previous sibling node.

This asks for the previous child of its parent.

Returns: Previous sibling node

RemoveAttributeNoDelete ( TAttributeType )

voidRemoveAttributeNoDelete(TAttributeTypeaAttributeType)[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.

ParameterDescription
aAttributeTypeAttribute type

ReparentL ( CNode * )

voidReparentL(CNode *aParent)[inline]

Reimplemented from CNode::ReparentL(CNode *)

Changes the parent of the node.

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

ParameterDescription
aParentNew parent

ResetDataPointer ( HBufC16 * )

voidResetDataPointer(HBufC16 *aData)[inline]

Resets the node data to a specified pointer.

Existing data owned by the node is deleted.

ParameterDescription
aDataRoot node

Root ( )

const CTypedNode &Root()const [inline]

Reimplemented from CNode::Root()const

Gets the absolute root node of the tree.

Returns: Root node

SetDataL ( HBufC16 * )

voidSetDataL(HBufC16 *aDataNowNodeOwns)[inline]

Reimplemented from CNode::SetDataL(HBufC16 *)

Sets the node data.

The object will delete the data in its destructor.

ParameterDescription
aDataNowNodeOwnsNode data

SetDataNoDeleteL ( )

voidSetDataNoDeleteL()[inline]

Reimplemented from CNode::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 * )

voidSetFileDataL(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.

ParameterDescription
aFileDataLocationNowNodeOwnsName of the file containing the data

SetType ( TNodeType )

voidSetType(TNodeTypeaType)[inline]

Sets the node type.

ParameterDescription
aTypeNode type

Type ( )

TNodeTypeType()const [inline]

Reimplemented from CNode::Type()const

Gets the node type.

Returns: Node type