CNode Class Reference

#include <mw/cnode.h>

Link against: wnode.lib

class CNode : public CBase

Inherits from

  • CNode
    Protected Attributes
    CArrayPtr< CNode > *iChildList
    CDataNoDelete *iDataValue
    CNode *iParent
    TAny *iType
    CArrayPtrFlat< TAny >iTypes
    TInt32 *iTypesBasePtr
    CArrayPtrFlat< CBase >iValues
    Public Member Functions
    ~CNode()
    IMPORT_C voidAddAttributeL(TAny *, CBase *)
    IMPORT_C voidAddDataAndAttributeL(HBufC16 *, TAny *, CBase *)
    IMPORT_C CNode &AppendNodeL(TAny *)
    IMPORT_C voidAppendNodeToThisNodeL(CNode *)
    IMPORT_C CBase *Attribute(TAny *)
    IMPORT_C CBase *AttributeByIndex(TInt)
    IMPORT_C CBase *AttributeByIndex(TInt, TAny *&)
    IMPORT_C TIntAttributeCount()
    IMPORT_C TBoolAttributeExists(TAny *)
    IMPORT_C TAny *AttributeTypeByIndex(TInt)
    IMPORT_C CNode *Child(TInt)
    IMPORT_C voidClearSetDataNoDeleteL()
    IMPORT_C HBufC16 *Data()
    IMPORT_C voidDeleteAllAttributes()
    IMPORT_C voidDeleteAllChildNodes()
    IMPORT_C voidDeleteAttribute(TAny *)
    IMPORT_C voidDeleteChildNode(CNode *)
    IMPORT_C CNode *NewL(TAny *, CNode *)
    IMPORT_C CNode *NextChild(const CNode *)
    IMPORT_C CNode *NextSibling()
    IMPORT_C TIntNumberImmediateChildren()
    IMPORT_C CNode *Parent()
    IMPORT_C CNode *PrevChild(const CNode &)
    IMPORT_C CNode *PrevSibling()
    IMPORT_C voidRemoveAttributeNoDelete(TAny *)
    IMPORT_C voidReparentL(CNode *)
    IMPORT_C voidResetDataPointer(HBufC16 *)
    IMPORT_C const CNode &Root()
    IMPORT_C voidSetDataL(HBufC16 *)
    IMPORT_C voidSetDataNoDeleteL()
    IMPORT_C voidSetFileDataL(HBufC16 *)
    IMPORT_C voidSetType(TAny *)
    IMPORT_C TAny *Type()
    Protected Member Functions
    CNode(TAny *, CNode *)
    voidAdjustBasePointers()
    TInt FindChild(const CNode *)
    HBufC16 *SetupDeletableOrNonDeleteableDataLC()
    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()

    Member Attribute Documentation

    iChildList

    CArrayPtr< CNode > *iChildList[protected]

    iDataValue

    CDataNoDelete *iDataValue[protected]

    iParent

    CNode *iParent[protected]

    iType

    TAny *iType[protected]

    iTypes

    CArrayPtrFlat< TAny >iTypes[protected]

    iTypesBasePtr

    TInt32 *iTypesBasePtr[protected]

    iValues

    CArrayPtrFlat< CBase >iValues[protected]

    Constructor & Destructor Documentation

    CNode ( TAny *, CNode * )

    CNode(TAny *aType,
    CNode *aParent
    )[protected]

    ~CNode ( )

    IMPORT_C~CNode()

    Destructor.

    Data (if owned by the object), child nodes and attributes are deleted.

    Member Function Documentation

    AddAttributeL ( TAny *, CBase * )

    IMPORT_C voidAddAttributeL(TAny *AttributeType,
    CBase *aAttributeValue
    )

    Adds an attribute.

    The node takes ownership of aAttributeValue.

    ParameterDescription
    AttributeTypeAttribute type
    aAttributeValueAttribute value

    AddDataAndAttributeL ( HBufC16 *, TAny *, CBase * )

    IMPORT_C voidAddDataAndAttributeL(HBufC16 *aData,
    TAny *AttributeType,
    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.

    ParameterDescription
    aDataNode data
    AttributeTypeAttribute type
    aAttributeValueAttribute value

    AdjustBasePointers ( )

    voidAdjustBasePointers()[protected]

    AppendNodeL ( TAny * )

    IMPORT_C CNode &AppendNodeL(TAny *aType = 0)

    Creates a new child node.

    ParameterDescription
    aTypeNode type

    Returns: The new child node

    AppendNodeToThisNodeL ( CNode * )

    IMPORT_C voidAppendNodeToThisNodeL(CNode *aNode)

    Adds an existing node as a child.

    ParameterDescription
    aNodeNode to make a child

    Attribute ( TAny * )

    IMPORT_C CBase *Attribute(TAny *AttributeType)const

    Gets an attribute value for a specified attribute type.

    ParameterDescription
    AttributeTypeAttribute type

    Returns: Attribute value

    AttributeByIndex ( TInt )

    IMPORT_C CBase *AttributeByIndex(TIntaIndex)const

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

    ParameterDescription
    aIndexAttribute index

    Returns: Attribute value

    AttributeByIndex ( TInt, TAny *& )

    IMPORT_C CBase *AttributeByIndex(TIntaIndex,
    TAny *&aType
    )const

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

    IMPORT_C TIntAttributeCount()const

    Gets the number of attributes of this node.

    Returns: Number of attributes of this node

    AttributeExists ( TAny * )

    IMPORT_C TBoolAttributeExists(TAny *aAttributeType)const

    Tests if an attribute of a specified type exists.

    ParameterDescription
    aAttributeTypeAttribute type

    Returns: True if the attribute exists, otherwise false

    AttributeTypeByIndex ( TInt )

    IMPORT_C TAny *AttributeTypeByIndex(TIntaIndex)const

    Gets the attribute value of an attribute at a specified index

    ParameterDescription
    aIndexAttribute index

    Returns: Attribute value

    Child ( TInt )

    IMPORT_C CNode *Child(TIntaByIndex)const

    Gets a child node by index.

    ParameterDescription
    aByIndexIndex of the child node

    Returns: Child node

    ClearSetDataNoDeleteL ( )

    IMPORT_C voidClearSetDataNoDeleteL()

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

    IMPORT_C HBufC16 *Data()const

    Gets the node data.

    Returns: Node data or NULL if no data is set

    DeleteAllAttributes ( )

    IMPORT_C voidDeleteAllAttributes()

    Delete all node attributes.

    Note that attribute values will be deleted.

    DeleteAllChildNodes ( )

    IMPORT_C voidDeleteAllChildNodes()

    Deletes all the child nodes of this node.

    DeleteAttribute ( TAny * )

    IMPORT_C voidDeleteAttribute(TAny *aAttributeType)

    Deletes an attribute of a specified type.

    Note that the attribute value will be deleted.

    ParameterDescription
    aAttributeTypeAttribute type

    DeleteChildNode ( CNode * )

    IMPORT_C voidDeleteChildNode(CNode *aNode)

    Deletes a specified child node.

    ParameterDescription
    aNodeNode to delete

    FindChild ( const CNode * )

    TInt FindChild(const CNode *aNode)const [protected]

    NewL ( TAny *, CNode * )

    IMPORT_C CNode *NewL(TAny *aType,
    CNode *aParent
    )[static]

    Allocates and constructs a new node.

    ParameterDescription
    aTypeThe type of the node
    aParentThe parent of this node

    Returns: New node

    NextChild ( const CNode * )

    IMPORT_C CNode *NextChild(const CNode *aNode = NULL)const

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

    IMPORT_C CNode *NextSibling()const

    Gets the next sibling node.

    This asks for the next child of its parent.

    Returns: Next sibling node

    NumberImmediateChildren ( )

    IMPORT_C TIntNumberImmediateChildren()const

    Gets the number of children of this node.

    Returns: Number of children of this node

    Parent ( )

    IMPORT_C CNode *Parent()const

    Gets the parent of this node.

    Returns: Parent

    PrevChild ( const CNode & )

    IMPORT_C CNode *PrevChild(const CNode &aNode)const

    Gets the previous child before a specified child.

    ParameterDescription
    aNodeChild node

    Returns: Previous child node

    PrevSibling ( )

    IMPORT_C CNode *PrevSibling()const

    Gets the previous sibling node.

    This asks for the previous child of its parent.

    Returns: Previous sibling node

    RemoveAttributeNoDelete ( TAny * )

    IMPORT_C voidRemoveAttributeNoDelete(TAny *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.

    ParameterDescription
    aAttributeTypeAttribute type

    ReparentL ( CNode * )

    IMPORT_C voidReparentL(CNode *aParent)

    Changes the parent of the node.

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

    ParameterDescription
    aParentNew parent

    ResetDataPointer ( HBufC16 * )

    IMPORT_C voidResetDataPointer(HBufC16 *aData)

    Resets the node data to a specified pointer.

    Existing data owned by the node is deleted.

    ParameterDescription
    aDataRoot node

    Root ( )

    IMPORT_C const CNode &Root()const

    Gets the absolute root node of the tree.

    Returns: Root node

    SetDataL ( HBufC16 * )

    IMPORT_C voidSetDataL(HBufC16 *aDataNowNodeOwns)

    Sets the node data.

    The object will delete the data in its destructor.

    ParameterDescription
    aDataNowNodeOwnsNode data

    SetDataNoDeleteL ( )

    IMPORT_C voidSetDataNoDeleteL()

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

    IMPORT_C voidSetFileDataL(HBufC16 *aFileDataLocationNowNodeOwns)

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

    IMPORT_C voidSetType(TAny *aType)

    Sets the node type.

    ParameterDescription
    aTypeNode type

    SetupDeletableOrNonDeleteableDataLC ( )

    HBufC16 *SetupDeletableOrNonDeleteableDataLC()[protected]

    Type ( )

    IMPORT_C TAny *Type()const

    Gets the node type.

    Returns: Node type