#include <mw/cnode.h>
class CTypedNode : public CNode |
Protected Member Functions | |
---|---|
CTypedNode(TNodeType, CNode *) |
Inherited Attributes | |
---|---|
CNode::iChildList | |
CNode::iDataValue | |
CNode::iParent | |
CNode::iType | |
CNode::iTypes | |
CNode::iTypesBasePtr | |
CNode::iValues |
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.
void | AddAttributeL | ( | TAttributeType | aAttributeType, |
CBase * | aAttributeValue | |||
) | [inline] |
Adds an attribute.
The node takes ownership of aAttributeValue.
Parameter | Description |
---|---|
aAttributeType | Attribute type |
aAttributeValue | Attribute value |
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.
Parameter | Description |
---|---|
aData | Node data |
aAttributeType | Attribute type |
aAttributeValue | Attribute value |
CTypedNode< TNodeType, TAttributeType > & | AppendNodeL | ( | TNodeType | aType | ) | [inline] |
Creates a new child node.
Parameter | Description |
---|---|
aType | Node type |
Returns: The new child node
void | AppendNodeToThisNodeL | ( | CNode * | aNode | ) | [inline] |
Reimplemented from CNode::AppendNodeToThisNodeL(CNode *)
Adds an existing node as a child.
Parameter | Description |
---|---|
aNode | Node to make a child |
CBase * | Attribute | ( | TAttributeType | aAttributeType | ) | const [inline] |
Gets an attribute value for a specified attribute type.
Parameter | Description |
---|---|
aAttributeType | Attribute type |
Returns: Attribute value
Reimplemented from CNode::AttributeByIndex(TInt)const
Gets the attribute value of an attribute at a specified index
Parameter | Description |
---|---|
aIndex | Attribute index |
Returns: Attribute value
TInt | AttributeCount | ( | ) | const [inline] |
Reimplemented from CNode::AttributeCount()const
Gets the number of attributes of this node.
Returns: Number of attributes of this node
TBool | AttributeExists | ( | TAttributeType | aAttributeType | ) | const [inline] |
Tests if an attribute of a specified type exists.
Parameter | Description |
---|---|
aAttributeType | Attribute type |
Returns: True if the attribute exists, otherwise false
TAttributeType | AttributeTypeByIndex | ( | TInt | aIndex | ) | const [inline] |
Reimplemented from CNode::AttributeTypeByIndex(TInt)const
Gets the attribute value of an attribute at a specified index
Parameter | Description |
---|---|
aIndex | Attribute index |
Returns: Attribute value
CTypedNode * | Child | ( | TInt | aByIndex | ) | const [inline] |
Reimplemented from CNode::Child(TInt)const
Gets a child node by index.
Parameter | Description |
---|---|
aByIndex | Index of the child node |
Returns: Child node
void | ClearSetDataNoDeleteL | ( | ) | [inline] |
Reimplemented from CNode::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.
HBufC16 * | Data | ( | ) | const [inline] |
Reimplemented from CNode::Data()const
Gets the node data.
Returns: Node data or NULL if no data is set
void | DeleteAllAttributes | ( | ) | [inline] |
Reimplemented from CNode::DeleteAllAttributes()
Delete all node attributes.
Note that attribute values will be deleted.
void | DeleteAllChildNodes | ( | ) | [inline] |
Reimplemented from CNode::DeleteAllChildNodes()
Deletes all the child nodes of this node.
void | DeleteAttribute | ( | TAttributeType | aAttributeType | ) | [inline] |
Deletes an attribute of a specified type.
Note that the attribute value will be deleted.
Parameter | Description |
---|---|
aAttributeType | Attribute type |
void | DeleteChildNode | ( | CNode * | aNode | ) | [inline] |
Reimplemented from CNode::DeleteChildNode(CNode *)
Deletes a specified child node.
Parameter | Description |
---|---|
aNode | Node to delete |
CTypedNode * | NewL | ( | TNodeType | aType, |
CNode * | aParent | |||
) | [static, inline] |
Allocates and constructs a new node.
Parameter | Description |
---|---|
aType | The type of the node |
aParent | The parent of this node |
Returns: New node
CTypedNode * | NextChild | ( | const CNode * | aNode = NULL | ) | const [inline] |
Reimplemented from CNode::NextChild(const CNode *)const
Gets the first child or the next child after a specified child.
Parameter | Description |
---|---|
aNode | Child node or NULL to get the first child |
Returns: First or next child node
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
TInt | NumberImmediateChildren | ( | ) | const [inline] |
Reimplemented from CNode::NumberImmediateChildren()const
Gets the number of children of this node.
Returns: Number of children of this node
CTypedNode * | Parent | ( | ) | const [inline] |
Reimplemented from CNode::Parent()const
Gets the parent of this node.
Returns: Parent
CTypedNode * | PrevChild | ( | const CNode & | aNode | ) | const [inline] |
Reimplemented from CNode::PrevChild(const CNode &)const
Gets the previous child before a specified child.
Parameter | Description |
---|---|
aNode | Child node |
Returns: Previous child node
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
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.
Parameter | Description |
---|---|
aAttributeType | Attribute type |
void | ReparentL | ( | 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.
Parameter | Description |
---|---|
aParent | New parent |
void | ResetDataPointer | ( | HBufC16 * | aData | ) | [inline] |
Reimplemented from CNode::ResetDataPointer(HBufC16 *)
Resets the node data to a specified pointer.
Existing data owned by the node is deleted.
Parameter | Description |
---|---|
aData | Root node |
const CTypedNode & | Root | ( | ) | const [inline] |
Reimplemented from CNode::Root()const
Gets the absolute root node of the tree.
Returns: Root node
void | SetDataL | ( | HBufC16 * | aDataNowNodeOwns | ) | [inline] |
Reimplemented from CNode::SetDataL(HBufC16 *)
Sets the node data.
The object will delete the data in its destructor.
Parameter | Description |
---|---|
aDataNowNodeOwns | Node data |
void | SetDataNoDeleteL | ( | ) | [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.
void | SetFileDataL | ( | HBufC16 * | aFileDataLocationNowNodeOwns | ) | [inline] |
Reimplemented from CNode::SetFileDataL(HBufC16 *)
Sets the node data to be taken from a specified file.
If the data is deleted, the referenced file is also deleted.
Parameter | Description |
---|---|
aFileDataLocationNowNodeOwns | Name of the file containing the data |
void | SetType | ( | TNodeType | aType | ) | [inline] |
Sets the node type.
Parameter | Description |
---|---|
aType | Node type |
TNodeType | Type | ( | ) | const [inline] |
Reimplemented from CNode::Type()const
Gets the node type.
Returns: Node type