CXdmDocumentNode Class Reference

class CXdmDocumentNode : public CBase

Inherits from

Public Member Functions
~CXdmDocumentNode()
IMPORT_C voidAppendChileNodeL(CXdmDocumentNode *)
IMPORT_C CXdmNodeAttribute *Attribute(TInt)
IMPORT_C CXdmNodeAttribute *Attribute(const TDesC &)
IMPORT_C TIntAttributeCount()
IMPORT_C CXdmDocumentNode *ChileNode(TInt)
IMPORT_C CXdmNodeAttribute *CreateAttributeL()
IMPORT_C CXdmNodeAttribute *CreateAttributeL(const TDesC &)
IMPORT_C CXdmDocumentNode *CreateChileNodeL()
IMPORT_C CXdmDocumentNode *CreateChileNodeL(const TDesC &)
IMPORT_C HBufC8 *EightBitNodeNameLC()
IMPORT_C HBufC8 *ElementDataLC()
IMPORT_C TXdmElementTypeElementType()
IMPORT_C HBufC8 *EscapeLeafNodeContentLC()
IMPORT_C TIntFind(const TDesC &, RPointerArray< CXdmDocumentNode > &)
IMPORT_C TIntFind(const CXdmDocumentNode &, RPointerArray< CXdmDocumentNode > &)
IMPORT_C TIntFind(const TDesC &, RPointerArray< CXdmDocumentNode > &, const RPointerArray< SXdmAttribute16 > &)
IMPORT_C TBoolHasAttribute(const TDesC &)
TBool HasAttribute(const CXdmNodeAttribute &)
TBool HasAttribute(const SXdmAttribute16 &)
TBool HasAttributeL(const SXdmAttribute8 &)
IMPORT_C voidInsertChileNodeL(TInt, CXdmDocumentNode *)
IMPORT_C TBoolIsEmptyNode()
IMPORT_C TBoolIsLeafNode()
IMPORT_C TPtrC8LeafNodeContent()
IMPORT_C TBoolMatch(const CXdmDocumentNode &)
IMPORT_C TBoolMatch(const TDesC &, const RPointerArray< SXdmAttribute8 > &)
IMPORT_C CXdmDocumentNode *NextNode()
IMPORT_C TIntNodeCount()
IMPORT_C TPtrCNodeName()
IMPORT_C CXdmDocumentNode *Parent()
IMPORT_C voidPrint()
IMPORT_C voidRemoveChileNodeL(CXdmDocumentNode *)
IMPORT_C voidReplaceChileNodeL(CXdmDocumentNode *, CXdmDocumentNode *)
IMPORT_C voidSetEmptyNode(TBool)
IMPORT_C voidSetLeafNode(TBool)
IMPORT_C voidSetLeafNodeContentL(const TDesC &)
IMPORT_C voidSetLeafNodeContentL(const TDesC8 &)
IMPORT_C voidSetNameL(const TDesC &)
IMPORT_C voidSetNameL(const TDesC8 &)
IMPORT_C voidSetNextNode(CXdmDocumentNode *)
IMPORT_C TBooloperator==(const CXdmDocumentNode &)
Protected Member Functions
CXdmDocumentNode(CXdmEngine &, MXdmNodeFactory &, CXdmDocumentNode *)
CXdmDocumentNode(CXdmEngine &, MXdmNodeFactory &)
CXdmDocumentNode(const TBool, CXdmEngine &, MXdmNodeFactory &, CXdmDocumentNode *)
IMPORT_C voidBaseConstructL(const TDesC &)
IMPORT_C voidCopyConstructL(const CXdmDocumentNode &, const CXdmDocumentNode &)
HBufC8 *EscapeDescLC(const TDesC8 &)
Private Member Functions
voidConstructAttributesL(const CXdmDocumentNode &)
voidConstructChildrenL(const CXdmDocumentNode &)
TInt DoFind(const TDesC &, RPointerArray< CXdmDocumentNode > &)
TInt DoFind(const CXdmDocumentNode &, RPointerArray< CXdmDocumentNode > &)
TInt DoFind(const TDesC &, RPointerArray< CXdmDocumentNode > &, const RPointerArray< SXdmAttribute16 > &)
voidRemoveNamespaceAttributes()
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()
Protected Attributes
RPointerArray< CXdmNodeAttribute >iAttributes
RPointerArray< CXdmDocumentNode >iChildren
TBool iEmptyNode
HBufC8 *iLeafContent
TBool iLeafNode
CXdmDocumentNode *iNextNode
MXdmNodeFactory &iNodeFactory
HBufC *iNodeName
CXdmDocumentNode *iParentNode
TInt iPosition
CXdmEngine &iXdmEngine

Constructor & Destructor Documentation

CXdmDocumentNode(CXdmEngine &, MXdmNodeFactory &, CXdmDocumentNode *)

IMPORT_CCXdmDocumentNode(CXdmEngine &aXdmEngine,
MXdmNodeFactory &aNodeFactory,
CXdmDocumentNode *aParentNode
)[protected]

C++ constructor, for derived classes

Parameters

CXdmEngine & aXdmEngine
MXdmNodeFactory & aNodeFactory
CXdmDocumentNode * aParentNode

CXdmDocumentNode(CXdmEngine &, MXdmNodeFactory &)

IMPORT_CCXdmDocumentNode(CXdmEngine &aXdmEngine,
MXdmNodeFactory &aNodeFactory
)[protected]

CC++ constructor, for derived classes

Parameters

CXdmEngine & aXdmEngine
MXdmNodeFactory & aNodeFactory

CXdmDocumentNode(const TBool, CXdmEngine &, MXdmNodeFactory &, CXdmDocumentNode *)

IMPORT_CCXdmDocumentNode(const TBoolaLeafNode,
CXdmEngine &aXdmEngine,
MXdmNodeFactory &aNodeFactory,
CXdmDocumentNode *aParentNode
)[protected]

C++ constructor, for derived classes

Parameters

const TBool aLeafNode
CXdmEngine & aXdmEngine
MXdmNodeFactory & aNodeFactory
CXdmDocumentNode * aParentNode

~CXdmDocumentNode()

IMPORT_C~CXdmDocumentNode()

Destructor.

Member Functions Documentation

AppendChileNodeL(CXdmDocumentNode *)

IMPORT_C voidAppendChileNodeL(CXdmDocumentNode *aChileNode)

Append a child node

Parameters

CXdmDocumentNode * aChileNode

Attribute(TInt)

IMPORT_C CXdmNodeAttribute *Attribute(TIntaPosition)const

Reference an attribute of this element specified by the position of the attribute

Parameters

TInt aPosition

Attribute(const TDesC &)

IMPORT_C CXdmNodeAttribute *Attribute(const TDesC &aAttributeName)const

Reference an attribute of this element specified by the position of the attribute

Parameters

const TDesC & aAttributeName

AttributeCount()

IMPORT_C TIntAttributeCount()const

Returns the number of attributes of this element

BaseConstructL(const TDesC &)

IMPORT_C voidBaseConstructL(const TDesC &aNodeName)[protected]

Symbian OS constructor for derived classes.

Parameters

const TDesC & aNodeName

ChileNode(TInt)

IMPORT_C CXdmDocumentNode *ChileNode(TIntaPosition)const

Returns a child node specified by its position among the descendants of an element

Parameters

TInt aPosition

ConstructAttributesL(const CXdmDocumentNode &)

voidConstructAttributesL(const CXdmDocumentNode &aAnotherNode)[private]

Copy the attributes of another element.

Parameters

const CXdmDocumentNode & aAnotherNode

ConstructChildrenL(const CXdmDocumentNode &)

voidConstructChildrenL(const CXdmDocumentNode &aAnotherNode)[private]

Copy the child nodes of another element.

Parameters

const CXdmDocumentNode & aAnotherNode

CopyConstructL(const CXdmDocumentNode &, const CXdmDocumentNode &)

IMPORT_C voidCopyConstructL(const CXdmDocumentNode &aAnotherNode,
const CXdmDocumentNode &aParentNode
)[protected, virtual]

Copy constructor

Parameters

const CXdmDocumentNode & aAnotherNode
const CXdmDocumentNode & aParentNode

CreateAttributeL()

IMPORT_C CXdmNodeAttribute *CreateAttributeL()

Create a new attribute

CreateAttributeL(const TDesC &)

IMPORT_C CXdmNodeAttribute *CreateAttributeL(const TDesC &aAttributeName)

Create a new attribute

Parameters

const TDesC & aAttributeName

CreateChileNodeL()

IMPORT_C CXdmDocumentNode *CreateChileNodeL()

Create a new child element

CreateChileNodeL(const TDesC &)

IMPORT_C CXdmDocumentNode *CreateChileNodeL(const TDesC &aChildName)

Create a new child element

Parameters

const TDesC & aChildName

DoFind(const TDesC &, RPointerArray< CXdmDocumentNode > &)

TInt DoFind(const TDesC &aNodeName,
RPointerArray< CXdmDocumentNode > &aResultArray
)const [private]

Search for nodes which match the specified name

Parameters

const TDesC & aNodeName
RPointerArray< CXdmDocumentNode > & aResultArray

DoFind(const CXdmDocumentNode &, RPointerArray< CXdmDocumentNode > &)

TInt DoFind(const CXdmDocumentNode &aTargetNode,
RPointerArray< CXdmDocumentNode > &aResultArray
)const [private]

Search for nodes which match the specified node

Parameters

const CXdmDocumentNode & aTargetNode
RPointerArray< CXdmDocumentNode > & aResultArray

DoFind(const TDesC &, RPointerArray< CXdmDocumentNode > &, const RPointerArray< SXdmAttribute16 > &)

TInt DoFind(const TDesC &aNodeName,
RPointerArray< CXdmDocumentNode > &aResultArray,
const RPointerArray< SXdmAttribute16 > &aAttributeArray
)[private]

Search for nodes which match the specified name & attributes

Parameters

const TDesC & aNodeName
RPointerArray< CXdmDocumentNode > & aResultArray
const RPointerArray< SXdmAttribute16 > & aAttributeArray

EightBitNodeNameLC()

IMPORT_C HBufC8 *EightBitNodeNameLC()const

Name of this element

ElementDataLC()

IMPORT_C HBufC8 *ElementDataLC()const

Returns the contents of a single element without any brackets and pushes the buffer onto the CleanupStack.

For instance:

'element attribute1 = "value" attribute2 = "another value"'

ElementType()

IMPORT_C TXdmElementTypeElementType()const [virtual]

The type of this element: an element or an attribute

EscapeDescLC(const TDesC8 &)

HBufC8 *EscapeDescLC(const TDesC8 &aDescriptor)const [protected]

Escape-code the specified string

Parameters

const TDesC8 & aDescriptor

EscapeLeafNodeContentLC()

IMPORT_C HBufC8 *EscapeLeafNodeContentLC()const

Return the contents of a leaf element escape-coded, if needed

Find(const TDesC &, RPointerArray< CXdmDocumentNode > &)

IMPORT_C TIntFind(const TDesC &aNodeName,
RPointerArray< CXdmDocumentNode > &aResultArray
)const

Search for nodes which match the specified name

Parameters

const TDesC & aNodeName
RPointerArray< CXdmDocumentNode > & aResultArray

Find(const CXdmDocumentNode &, RPointerArray< CXdmDocumentNode > &)

IMPORT_C TIntFind(const CXdmDocumentNode &aTargetNode,
RPointerArray< CXdmDocumentNode > &aResultArray
)const

Search for nodes which match the specified node

Parameters

const CXdmDocumentNode & aTargetNode
RPointerArray< CXdmDocumentNode > & aResultArray

Find(const TDesC &, RPointerArray< CXdmDocumentNode > &, const RPointerArray< SXdmAttribute16 > &)

IMPORT_C TIntFind(const TDesC &aNodeName,
RPointerArray< CXdmDocumentNode > &aResultArray,
const RPointerArray< SXdmAttribute16 > &aAttributeArray
)const

Search for nodes which match the specified name & attributes

Parameters

const TDesC & aNodeName
RPointerArray< CXdmDocumentNode > & aResultArray
const RPointerArray< SXdmAttribute16 > & aAttributeArray

HasAttribute(const TDesC &)

IMPORT_C TBoolHasAttribute(const TDesC &aAttributeName)const

The type of this element: an element or an attribute

Parameters

const TDesC & aAttributeName

HasAttribute(const CXdmNodeAttribute &)

TBool HasAttribute(const CXdmNodeAttribute &aNode)const

Check whether an element has the specified attribute

Parameters

const CXdmNodeAttribute & aNode

HasAttribute(const SXdmAttribute16 &)

TBool HasAttribute(const SXdmAttribute16 &aAttribute)const

Check whether an element has the specified attribute

Parameters

const SXdmAttribute16 & aAttribute

HasAttributeL(const SXdmAttribute8 &)

TBool HasAttributeL(const SXdmAttribute8 &aAttribute)const

Check whether an element has the specified attribute

Parameters

const SXdmAttribute8 & aAttribute

InsertChileNodeL(TInt, CXdmDocumentNode *)

IMPORT_C voidInsertChileNodeL(TIntaIndex,
CXdmDocumentNode *aChileNode
)

Insert a child node to the given position

Parameters

TInt aIndex
CXdmDocumentNode * aChileNode

IsEmptyNode()

IMPORT_C TBoolIsEmptyNode()const

Report whether or not this element is empty

IsLeafNode()

IMPORT_C TBoolIsLeafNode()const

Report whether or not this is a leaf element

LeafNodeContent()

IMPORT_C TPtrC8LeafNodeContent()const

Return the contents of a leaf element

Match(const CXdmDocumentNode &)

IMPORT_C TBoolMatch(const CXdmDocumentNode &aAnotherNode)const

The type of this element: an element or an attribute

Parameters

const CXdmDocumentNode & aAnotherNode

Match(const TDesC &, const RPointerArray< SXdmAttribute8 > &)

IMPORT_C TBoolMatch(const TDesC &aNodeName,
const RPointerArray< SXdmAttribute8 > &aAttributeArray
)const

The type of this element: an element or an attribute

Parameters

const TDesC & aNodeName
const RPointerArray< SXdmAttribute8 > & aAttributeArray

NextNode()

IMPORT_C CXdmDocumentNode *NextNode()const

Return the next node in the list

NodeCount()

IMPORT_C TIntNodeCount()const

Returns the number of child & lealf elements

NodeName()

IMPORT_C TPtrCNodeName()const

Name of this element

Parent()

IMPORT_C CXdmDocumentNode *Parent()const

Return the parent node of this element

Print()

IMPORT_C voidPrint()

Print the contents of this node to the log file

RemoveChileNodeL(CXdmDocumentNode *)

IMPORT_C voidRemoveChileNodeL(CXdmDocumentNode *aChileNode)

Remove a child node

Parameters

CXdmDocumentNode * aChileNode

RemoveNamespaceAttributes()

voidRemoveNamespaceAttributes()[private]

Remove namespace attributes from this element. Namespaces must not be used when comparing two elements, which is why these attributes need to be removed before the comparison.

ReplaceChileNodeL(CXdmDocumentNode *, CXdmDocumentNode *)

IMPORT_C voidReplaceChileNodeL(CXdmDocumentNode *aNewNode,
CXdmDocumentNode *aTargetNode
)

Replace a child node

Parameters

CXdmDocumentNode * aNewNode
CXdmDocumentNode * aTargetNode

SetEmptyNode(TBool)

IMPORT_C voidSetEmptyNode(TBoolaIsEmptyNode)

Define this node to be empty. Default value is EFalse, so this method only needs to be called when the client wants to indicate that a node does not/will not have children. The operation can be reverted if needed.

NOTE: An attempt to create children on an empty node will result in a panic being raised. Respectively, if a client application wants to revert the state of a node from non-empty to empty, all children that may have been created will be removed.

Parameters

TBool aIsEmptyNode

SetLeafNode(TBool)

IMPORT_C voidSetLeafNode(TBoolaIsLeafNode)

Define this node to be a leaf node. Default value is EFalse, so this method only needs to be called when the client wants to define a node a leaf node. The operation can, of course, be reverted if needed.

Parameters

TBool aIsLeafNode

SetLeafNodeContentL(const TDesC &)

IMPORT_C voidSetLeafNodeContentL(const TDesC &aLeafContent)

Set the contents of a leaf node. Fails if this element is not a leaf element.

<leaf>leafnodecontent</leaf>

Parameters

const TDesC & aLeafContent

SetLeafNodeContentL(const TDesC8 &)

IMPORT_C voidSetLeafNodeContentL(const TDesC8 &aLeafContent)

Set the contents of a leaf node. Fails if this element is not a leaf element.

<leaf>leafnodecontent</leaf>

Parameters

const TDesC8 & aLeafContent

SetNameL(const TDesC &)

IMPORT_C voidSetNameL(const TDesC &aNodeName)

(Re-)Set the name of this element

Parameters

const TDesC & aNodeName

SetNameL(const TDesC8 &)

IMPORT_C voidSetNameL(const TDesC8 &aNodeName)

(Re-)Set the name of this element

Parameters

const TDesC8 & aNodeName

SetNextNode(CXdmDocumentNode *)

IMPORT_C voidSetNextNode(CXdmDocumentNode *aNextNode)

Set the next node in the list

Parameters

CXdmDocumentNode * aNextNode

operator==(const CXdmDocumentNode &)

IMPORT_C TBooloperator==(const CXdmDocumentNode &aNode)const

Comparison operator

Parameters

const CXdmDocumentNode & aNode

Member Data Documentation

RPointerArray< CXdmNodeAttribute > iAttributes

RPointerArray< CXdmNodeAttribute >iAttributes[protected]

RPointerArray< CXdmDocumentNode > iChildren

RPointerArray< CXdmDocumentNode >iChildren[protected]

TBool iEmptyNode

TBool iEmptyNode[protected]

HBufC8 * iLeafContent

HBufC8 *iLeafContent[protected]

TBool iLeafNode

TBool iLeafNode[protected]

CXdmDocumentNode * iNextNode

CXdmDocumentNode *iNextNode[protected]

MXdmNodeFactory & iNodeFactory

MXdmNodeFactory &iNodeFactory[protected]

HBufC * iNodeName

HBufC *iNodeName[protected]

CXdmDocumentNode * iParentNode

CXdmDocumentNode *iParentNode[protected]

TInt iPosition

TInt iPosition[protected]

CXdmEngine & iXdmEngine

CXdmEngine &iXdmEngine[protected]