CXdmDocumentNode Class Reference

class CXdmDocumentNode : public CBase

Inherits from

Public Member Functions
~CXdmDocumentNode ()
IMPORT_C void AppendChileNodeL ( CXdmDocumentNode *)
IMPORT_C CXdmNodeAttribute * Attribute ( TInt )
IMPORT_C CXdmNodeAttribute * Attribute (const TDesC &)
IMPORT_C TInt AttributeCount ()
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 TXdmElementType ElementType ()
IMPORT_C HBufC8 * EscapeLeafNodeContentLC ()
IMPORT_C TInt Find (const TDesC &, RPointerArray < CXdmDocumentNode > &)
IMPORT_C TInt Find (const CXdmDocumentNode &, RPointerArray < CXdmDocumentNode > &)
IMPORT_C TInt Find (const TDesC &, RPointerArray < CXdmDocumentNode > &, const RPointerArray < SXdmAttribute16 > &)
IMPORT_C TBool HasAttribute (const TDesC &)
TBool HasAttribute (const CXdmNodeAttribute &)
TBool HasAttribute (const SXdmAttribute16 &)
TBool HasAttributeL (const SXdmAttribute8 &)
IMPORT_C void InsertChileNodeL ( TInt , CXdmDocumentNode *)
IMPORT_C TBool IsEmptyNode ()
IMPORT_C TBool IsLeafNode ()
IMPORT_C TPtrC8 LeafNodeContent ()
IMPORT_C TBool Match (const CXdmDocumentNode &)
IMPORT_C TBool Match (const TDesC &, const RPointerArray < SXdmAttribute8 > &)
IMPORT_C CXdmDocumentNode * NextNode ()
IMPORT_C TInt NodeCount ()
IMPORT_C TPtrC NodeName ()
IMPORT_C CXdmDocumentNode * Parent ()
IMPORT_C void Print ()
IMPORT_C void RemoveChileNodeL ( CXdmDocumentNode *)
IMPORT_C void ReplaceChileNodeL ( CXdmDocumentNode *, CXdmDocumentNode *)
IMPORT_C void SetEmptyNode ( TBool )
IMPORT_C void SetLeafNode ( TBool )
IMPORT_C void SetLeafNodeContentL (const TDesC &)
IMPORT_C void SetLeafNodeContentL (const TDesC8 &)
IMPORT_C void SetNameL (const TDesC &)
IMPORT_C void SetNameL (const TDesC8 &)
IMPORT_C void SetNextNode ( CXdmDocumentNode *)
IMPORT_C TBool operator== (const CXdmDocumentNode &)
Protected Member Functions
CXdmDocumentNode ( CXdmEngine &, MXdmNodeFactory &, CXdmDocumentNode *)
CXdmDocumentNode ( CXdmEngine &, MXdmNodeFactory &)
CXdmDocumentNode (const TBool , CXdmEngine &, MXdmNodeFactory &, CXdmDocumentNode *)
IMPORT_C void BaseConstructL (const TDesC &)
IMPORT_C void CopyConstructL (const CXdmDocumentNode &, const CXdmDocumentNode &)
HBufC8 * EscapeDescLC (const TDesC8 &)
Private Member Functions
void ConstructAttributesL (const CXdmDocumentNode &)
void ConstructChildrenL (const CXdmDocumentNode &)
TInt DoFind (const TDesC &, RPointerArray < CXdmDocumentNode > &)
TInt DoFind (const CXdmDocumentNode &, RPointerArray < CXdmDocumentNode > &)
TInt DoFind (const TDesC &, RPointerArray < CXdmDocumentNode > &, const RPointerArray < SXdmAttribute16 > &)
void RemoveNamespaceAttributes ()
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_C CXdmDocumentNode ( CXdmEngine & aXdmEngine,
MXdmNodeFactory & aNodeFactory,
CXdmDocumentNode * aParentNode
) [protected]

C++ constructor, for derived classes

Parameters

CXdmEngine & aXdmEngine
MXdmNodeFactory & aNodeFactory
CXdmDocumentNode * aParentNode

CXdmDocumentNode(CXdmEngine &, MXdmNodeFactory &)

IMPORT_C CXdmDocumentNode ( CXdmEngine & aXdmEngine,
MXdmNodeFactory & aNodeFactory
) [protected]

CC++ constructor, for derived classes

Parameters

CXdmEngine & aXdmEngine
MXdmNodeFactory & aNodeFactory

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

IMPORT_C CXdmDocumentNode ( const TBool aLeafNode,
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 void AppendChileNodeL ( CXdmDocumentNode * aChileNode )

Append a child node

Parameters

CXdmDocumentNode * aChileNode

Attribute(TInt)

IMPORT_C CXdmNodeAttribute * Attribute ( TInt aPosition ) 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 TInt AttributeCount ( ) const

Returns the number of attributes of this element

BaseConstructL(const TDesC &)

IMPORT_C void BaseConstructL ( const TDesC & aNodeName ) [protected]

Symbian OS constructor for derived classes.

Parameters

const TDesC & aNodeName

ChileNode(TInt)

IMPORT_C CXdmDocumentNode * ChileNode ( TInt aPosition ) const

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

Parameters

TInt aPosition

ConstructAttributesL(const CXdmDocumentNode &)

void ConstructAttributesL ( const CXdmDocumentNode & aAnotherNode ) [private]

Copy the attributes of another element.

Parameters

const CXdmDocumentNode & aAnotherNode

ConstructChildrenL(const CXdmDocumentNode &)

void ConstructChildrenL ( const CXdmDocumentNode & aAnotherNode ) [private]

Copy the child nodes of another element.

Parameters

const CXdmDocumentNode & aAnotherNode

CopyConstructL(const CXdmDocumentNode &, const CXdmDocumentNode &)

IMPORT_C void CopyConstructL ( 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 TXdmElementType ElementType ( ) 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 TInt Find ( 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 TInt Find ( 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 TInt Find ( 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 TBool HasAttribute ( 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 void InsertChileNodeL ( TInt aIndex,
CXdmDocumentNode * aChileNode
)

Insert a child node to the given position

Parameters

TInt aIndex
CXdmDocumentNode * aChileNode

IsEmptyNode()

IMPORT_C TBool IsEmptyNode ( ) const

Report whether or not this element is empty

IsLeafNode()

IMPORT_C TBool IsLeafNode ( ) const

Report whether or not this is a leaf element

LeafNodeContent()

IMPORT_C TPtrC8 LeafNodeContent ( ) const

Return the contents of a leaf element

Match(const CXdmDocumentNode &)

IMPORT_C TBool Match ( 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 TBool Match ( 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 TInt NodeCount ( ) const

Returns the number of child & lealf elements

NodeName()

IMPORT_C TPtrC NodeName ( ) const

Name of this element

Parent()

IMPORT_C CXdmDocumentNode * Parent ( ) const

Return the parent node of this element

Print()

IMPORT_C void Print ( )

Print the contents of this node to the log file

RemoveChileNodeL(CXdmDocumentNode *)

IMPORT_C void RemoveChileNodeL ( CXdmDocumentNode * aChileNode )

Remove a child node

Parameters

CXdmDocumentNode * aChileNode

RemoveNamespaceAttributes()

void RemoveNamespaceAttributes ( ) [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 void ReplaceChileNodeL ( CXdmDocumentNode * aNewNode,
CXdmDocumentNode * aTargetNode
)

Replace a child node

Parameters

CXdmDocumentNode * aNewNode
CXdmDocumentNode * aTargetNode

SetEmptyNode(TBool)

IMPORT_C void SetEmptyNode ( TBool aIsEmptyNode )

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 void SetLeafNode ( TBool aIsLeafNode )

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 void SetLeafNodeContentL ( 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 void SetLeafNodeContentL ( 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 void SetNameL ( const TDesC & aNodeName )

(Re-)Set the name of this element

Parameters

const TDesC & aNodeName

SetNameL(const TDesC8 &)

IMPORT_C void SetNameL ( const TDesC8 & aNodeName )

(Re-)Set the name of this element

Parameters

const TDesC8 & aNodeName

SetNextNode(CXdmDocumentNode *)

IMPORT_C void SetNextNode ( CXdmDocumentNode * aNextNode )

Set the next node in the list

Parameters

CXdmDocumentNode * aNextNode

operator==(const CXdmDocumentNode &)

IMPORT_C TBool operator== ( 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]