#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.
CTypedNode | ( | TNodeType | aType, |
CNode * | aParent | ||
) | [protected, inline] |
void | AddAttributeL | ( | TAttributeType | aAttributeType, |
CBase * | aAttributeValue | |||
) | [inline] |
Adds an attribute.
The node takes ownership of aAttributeValue.
Parameters | |
---|---|
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.
Parameters | |
---|---|
aData | Node data |
aAttributeType | Attribute type |
aAttributeValue | Attribute value |
CTypedNode< TNodeType, TAttributeType > & | AppendNodeL | ( | TNodeType | aType | ) | [inline] |
Creates a new child node.
Parameters | |
---|---|
aType | Node type |
void | AppendNodeToThisNodeL | ( | CNode * | aNode | ) | [inline] |
Reimplemented from CNode::AppendNodeToThisNodeL(CNode *)
Adds an existing node as a child.
Parameters | |
---|---|
aNode | Node to make a child |
CBase * | Attribute | ( | TAttributeType | aAttributeType | ) | const [inline] |
Gets an attribute value for a specified attribute type.
Parameters | |
---|---|
aAttributeType | Attribute type |
Reimplemented from CNode::AttributeByIndex(TInt)const
Gets the attribute value of an attribute at a specified index
Parameters | |
---|---|
aIndex | Attribute index |
TInt | AttributeCount | ( | ) | const [inline] |
Reimplemented from CNode::AttributeCount()const
Gets the number of attributes of this node.
TBool | AttributeExists | ( | TAttributeType | aAttributeType | ) | const [inline] |
Tests if an attribute of a specified type exists.
Parameters | |
---|---|
aAttributeType | Attribute type |
TAttributeType | AttributeTypeByIndex | ( | TInt | aIndex | ) | const [inline] |
Reimplemented from CNode::AttributeTypeByIndex(TInt)const
Gets the attribute value of an attribute at a specified index
Parameters | |
---|---|
aIndex | Attribute index |
CTypedNode * | Child | ( | TInt | aByIndex | ) | const [inline] |
Reimplemented from CNode::Child(TInt)const
Gets a child node by index.
Parameters | |
---|---|
aByIndex | Index of the 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.
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.
Parameters | |
---|---|
aAttributeType | Attribute type |
void | DeleteChildNode | ( | CNode * | aNode | ) | [inline] |
Reimplemented from CNode::DeleteChildNode(CNode *)
Deletes a specified child node.
Parameters | |
---|---|
aNode | Node to delete |
CTypedNode * | NewL | ( | TNodeType | aType, |
CNode * | aParent | |||
) | [static, inline] |
Allocates and constructs a new node.
Parameters | |
---|---|
aType | The type of the node |
aParent | The parent of this 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.
Parameters | |
---|---|
aNode | Child node or NULL to get the first child |
CTypedNode * | NextSibling | ( | ) | const [inline] |
Reimplemented from CNode::NextSibling()const
Gets the next sibling node.
This asks for the next child of its parent.
TInt | NumberImmediateChildren | ( | ) | const [inline] |
Reimplemented from CNode::NumberImmediateChildren()const
Gets the number of children of this node.
CTypedNode * | Parent | ( | ) | const [inline] |
Reimplemented from CNode::Parent()const
Gets the parent of this node.
CTypedNode * | PrevChild | ( | const CNode & | aNode | ) | const [inline] |
Reimplemented from CNode::PrevChild(const CNode &)const
Gets the previous child before a specified child.
Parameters | |
---|---|
aNode | 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.
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 | |
---|---|
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.
Parameters | |
---|---|
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.
Parameters | |
---|---|
aData | Root node |
const CTypedNode & | Root | ( | ) | const [inline] |
Reimplemented from CNode::Root()const
Gets the absolute root node of the tree.
void | SetDataL | ( | HBufC16 * | aDataNowNodeOwns | ) | [inline] |
Reimplemented from CNode::SetDataL(HBufC16 *)
Sets the node data.
The object will delete the data in its destructor.
Parameters | |
---|---|
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.
Parameters | |
---|---|
aFileDataLocationNowNodeOwns | Name of the file containing the data |
void | SetType | ( | TNodeType | aType | ) | [inline] |
Sets the node type.
Parameters | |
---|---|
aType | Node type |
TNodeType | Type | ( | ) | const [inline] |
Reimplemented from CNode::Type()const
Gets the node type.