![Symbian Developer Library](../../../../a_stock/images/mainheading.gif)
![]() |
![]() |
|
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
.
CBase
-
Base class for all classes to be instantiated on the heap.
CNode
- (No abstract)
CTypedNode
- Template class for a node in a node tree.
Defined in CTypedNode
:
AddAttributeL(TAttributeType,CBase *)
Adds an attribute.AddDataAndAttributeL(HBufC16 *,TAttributeType,CBase *)
Sets node data and adds an attribute.AppendNodeL(TNodeType)
Creates a new child node.AppendNodeToThisNodeL(CNode *)
Adds an existing node as a child.Attribute(TAttributeType)const
Gets an attribute value for a specified attribute type.AttributeByIndex(TInt)const
Gets the attribute value of an attribute at a specified indexAttributeByIndex(TInt,TAttributeType &)const
Gets the attribute value and type of an attribute at a specified index..AttributeCount()const
Gets the number of attributes of this node.AttributeExists(TAttributeType)const
Tests if an attribute of a specified type exists.AttributeTypeByIndex(TInt)const
Gets the attribute value of an attribute at a specified indexCTypedNode(TNodeType,CNode *)
Child(TInt)const
Gets a child node by index.ClearSetDataNoDeleteL()
Sets the object to delete the node data in its destructor.Data()const
Gets the node data.DeleteAllAttributes()
Delete all node attributes.DeleteAllChildNodes()
Deletes all the child nodes of this node. DeleteAttribute(TAttributeType)
Deletes an attribute of a specified type.DeleteChildNode(CNode *)
Deletes a specified child node.NewL(TNodeType,CNode *)
Allocates and constructs a new node.NextChild(const CNode *)const
Gets the first child or the next child after a specified child.NextSibling()const
Gets the next sibling node.NumberImmediateChildren()const
Gets the number of children of this node.Parent()const
Gets the parent of this node.PrevChild(const CNode &)const
Gets the previous child before a specified child.PrevSibling()const
Gets the previous sibling node.RemoveAttributeNoDelete(TAttributeType)
Removes an attribute of a specified type, but does not delete it.ReparentL(CNode *)
Changes the parent of the node.ResetDataPointer(HBufC16 *)
Resets the node data to a specified pointer.Root()const
Gets the absolute root node of the tree.SetDataL(HBufC16 *)
Sets the node data.SetDataNoDeleteL()
Sets the object not to delete the node data in its destructor.SetFileDataL(HBufC16 *)
Sets the node data to be taken from a specified file.SetType(TNodeType)
Sets the node type.Type()const
Gets the node type.Inherited from CBase
:
Delete(CBase *)
Deletes the specified object.Extension_(TUint,TAny *&,TAny *)
Extension function operator new(TUint)
Allocates the object from the heap and then initialises its contents to binary z...operator new(TUint,TAny *)
Initialises the object to binary zeroes.operator new(TUint,TLeave)
Allocates the object from the heap and then initialises its contents to binary z...operator new(TUint,TLeave,TUint)
Allocates the object from the heap and then initialises its contents to binary z...operator new(TUint,TUint)
Allocates the object from the heap and then initialises its contents to binary z...Inherited from CNode
:
AddAttributeL(TAny *,CBase *)
Adds an attribute.AddDataAndAttributeL(HBufC16 *,TAny *,CBase *)
Sets node data and adds an attribute.AppendNodeL(TAny *)
Creates a new child node.Attribute(TAny *)const
Gets an attribute value for a specified attribute type.AttributeByIndex(TInt,TAny *&)const
Gets the attribute value and type of an attribute at a specified index..AttributeExists(TAny *)const
Tests if an attribute of a specified type exists.DeleteAttribute(TAny *)
Deletes an attribute of a specified type.NewL(TAny *,CNode *)
Allocates and constructs a new node.RemoveAttributeNoDelete(TAny *)
Removes an attribute of a specified type, but does not delete it.SetType(TAny *)
Sets the node type.iChildList
iDataValue
iParent
iType
iTypes
iTypesBasePtr
iValues
static inline CTypedNode* NewL(TNodeType aType, CNode *aParent);
Allocates and constructs a new node.
|
|
protected: inline CTypedNode(TNodeType aType, CNode *aParent);
|
inline void DeleteChildNode(CNode *aNode);
Deletes a specified child node.
|
inline CTypedNode< TNodeType, TAttributeType >& AppendNodeL(TNodeType aType);
Creates a new child node.
|
|
inline void AppendNodeToThisNodeL(CNode *aNode);
Adds an existing node as a child.
|
inline void SetDataL(HBufC16 *aDataNowNodeOwns);
Sets the node data.
The object will delete the data in its destructor.
|
inline 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.
inline 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.
inline 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.
|
inline void ResetDataPointer(HBufC16 *aData);
Resets the node data to a specified pointer.
Existing data owned by the node is deleted.
|
inline HBufC16* Data() const;
Gets the node data.
|
inline const CTypedNode& Root() const;
Gets the absolute root node of the tree.
|
inline CTypedNode* Child(TInt aByIndex) const;
Gets a child node by index.
|
|
inline CTypedNode* NextChild(const CNode *aNode=0) const;
Gets the first child or the next child after a specified child.
|
|
inline CTypedNode* PrevChild(const CNode &aNode) const;
Gets the previous child before a specified child.
|
|
inline CTypedNode* Parent() const;
Gets the parent of this node.
|
inline void ReparentL(CNode *aParent);
Changes the parent of the node.
The node is removed from the childlist of its current parent.
|
inline CTypedNode* NextSibling() const;
Gets the next sibling node.
This asks for the next child of its parent.
|
inline CTypedNode* PrevSibling() const;
Gets the previous sibling node.
This asks for the previous child of its parent.
|
inline TInt NumberImmediateChildren() const;
Gets the number of children of this node.
|
inline void DeleteAttribute(TAttributeType aAttributeType);
Deletes an attribute of a specified type.
Note that the attribute value will be deleted.
|
inline void DeleteAllAttributes();
Delete all node attributes.
Note that attribute values will be deleted.
inline void RemoveAttributeNoDelete(TAttributeType 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.
|
inline TInt AttributeCount() const;
Gets the number of attributes of this node.
|
inline TAttributeType AttributeTypeByIndex(TInt aIndex) const;
Gets the attribute value of an attribute at a specified index
|
|
inline CBase* AttributeByIndex(TInt aIndex) const;
Gets the attribute value of an attribute at a specified index
|
|
inline CBase* AttributeByIndex(TInt aIndex, TAttributeType &aType) const;
Gets the attribute value and type of an attribute at a specified index..
|
|
inline void AddAttributeL(TAttributeType aAttributeType, CBase *aAttributeValue);
Adds an attribute.
The node takes ownership of aAttributeValue.
|
inline void AddDataAndAttributeL(HBufC16 *aData, TAttributeType aAttributeType, 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.
|
inline CBase* Attribute(TAttributeType aAttributeType) const;
Gets an attribute value for a specified attribute type.
|
|
inline TBool AttributeExists(TAttributeType aAttributeType) const;
Tests if an attribute of a specified type exists.
|
|
inline void SetType(TNodeType aType);
Sets the node type.
|