CSenElement Class Reference
class CSenElement : public CBase
|
Abstract class definition of XML element SenXML.dll
-
Since
-
Series60 3.0
Public Member Functions
|
void
|
AddAttrL
(const
TDesC8
&, const
TDesC8
&)
|
void
|
AddAttributesL
(const
RAttributeArray
&)
|
CSenElement
&
|
AddElementL
(
CSenElement
&)
|
CSenElement
&
|
AddElementL
(const
TDesC8
&, const
TDesC8
&)
|
CSenElement
&
|
AddElementL
(const
TDesC8
&, const
TDesC8
&, const
TDesC8
&)
|
CSenElement
&
|
AddElementL
(const
TDesC8
&)
|
const
CSenNamespace
*
|
AddNamespaceL
(const
TDesC8
&, const
TDesC8
&)
|
const
CSenNamespace
*
|
AddNamespaceL
(
CSenNamespace
&,
TBool
)
|
MSenElement
*
|
AsElement
()
|
HBufC8
*
|
AsXmlL
()
|
HBufC
*
|
AsXmlUnicodeL
()
|
const
TDesC8
*
|
AttrValue
(const
TDesC8
&)
|
RPointerArray
<
CSenBaseAttribute
> &
|
AttributesL
()
|
CSenElement
*
|
Child
(
TInt
)
|
TBool
|
ConsistsOfL
(
MSenElement
&)
|
TPtrC8
|
Content
()
|
HBufC
*
|
ContentUnicodeL
()
|
RWriteStream
&
|
ContentWriteStreamL
()
|
void
|
CopyFromL
(
CSenElement
&)
|
CSenElement
*
|
CreateElementL
(const
TDesC8
&, const
TDesC8
&)
|
CSenElement
*
|
DetachL
()
|
CSenElement
*
|
Element
(const
TDesC8
&)
|
CSenElement
*
|
Element
(const
TDesC8
&, const
TDesC8
&)
|
TInt
|
ElementsL
(
RPointerArray
<
CSenElement
> &, const
TDesC8
&, const
TDesC8
&)
|
TInt
|
ElementsL
(
RPointerArray
<
CSenElement
> &, const
TDesC8
&)
|
RPointerArray
<
CSenElement
> &
|
ElementsL
()
|
TBool
|
HasContent
()
|
CSenElement
&
|
InsertElementL
(
CSenElement
&, const
CSenElement
&)
|
const
TDesC8
&
|
LocalName
()
|
const
CSenNamespace
*
|
Namespace
()
|
const
CSenNamespace
*
|
Namespace
(const
TDesC8
&)
|
const
CSenNamespace
*
|
Namespace
(const
TDesC8
&, const
TDesC8
&)
|
const
CSenNamespace
*
|
Namespace
(const
TDesC8
&, const
TBool
)
|
const
TDesC8
&
|
NamespaceURI
()
|
RPointerArray
<
CSenNamespace
> &
|
NamespacesL
()
|
const
TDesC8
&
|
NsPrefix
()
|
CSenElement
*
|
Parent
()
|
CSenElement
*
|
RemoveElement
(
CSenElement
&)
|
CSenElement
*
|
RemoveElement
(const
TDesC8
&, const
TDesC8
&)
|
CSenElement
*
|
RemoveElement
(const
TDesC8
&)
|
CSenElement
*
|
ReplaceElementL
(
CSenElement
&)
|
MSenElement
&
|
Root
()
|
void
|
Set
(const
TDesC8
&, const
TDesC8
&, const
TDesC8
&)
|
TPtrC8
|
SetContentL
(const
TDesC8
&)
|
void
|
SetNamespaceL
(const
TDesC8
&)
|
void
|
SetNamespaceL
(const
TDesC8
&, const
TDesC8
&)
|
CSenElement
*
|
SetParent
(
CSenElement
*)
|
void
|
SetPrefixL
(const
TDesC8
&)
|
void
|
WriteAsXMLToL
(
RWriteStream
&)
|
void
|
WriteNamespacesToL
(
RWriteStream
&)
|
Member Functions Documentation
AddAttrL(const TDesC8 &, const TDesC8 &)
void
|
AddAttrL
|
(
|
const
TDesC8
&
|
aName,
|
|
const
TDesC8
&
|
aValue
|
|
)
|
[pure virtual]
|
Adds an attribute. If attribute is already existing, the value of the attribute will be replaced.
-
Since
-
Series60 3.0
Parameters
const
TDesC8
& aName
|
Name of the attribute to be added.
|
const
TDesC8
& aValue
|
Value of the attribute to be added.
|
AddAttributesL(const RAttributeArray &)
Adds new attributes to the element.
-
Since
-
Series60 3.0
AddElementL(CSenElement &)
Adds an Element to the children elements. Sets this element to be the new parent of the given element.
-
Since
-
Series60 3.0
AddElementL(const TDesC8 &, const TDesC8 &)
Constructs and adds a new element to the children elements. Sets this element to be the new parent of the given element.
-
Since
-
Series60 3.0
Parameters
const
TDesC8
& aNsUri
|
namespace URI of the new element
|
const
TDesC8
& aLocalName
|
local name of the new element
|
AddElementL(const TDesC8 &, const TDesC8 &, const TDesC8 &)
Constructs and adds a new element to the children elements. Sets this element to be the new parent of the given element.
-
Since
-
Series60 3.0
KErrSenZeroLengthDescriptor if aLocalName or aQName is zero length.
Parameters
const
TDesC8
& aNsUri
|
namespace URI of the new element
|
const
TDesC8
& aLocalName
|
local name of the new element
|
const
TDesC8
& aQName
|
qualified name of the new element
|
AddElementL(const TDesC8 &)
Constructs and adds a new element to the children elements. Sets this element to be the new parent of the given element. Note: Element is created with no specific namespace, default namespace of some of the upper level elements are in effect if there is such a namespace.
-
Since
-
Series60 3.0
KErrSenZeroLengthDescriptor if aLocalName is zero length.
Parameters
const
TDesC8
& aLocalName
|
local name of the new element
|
AddNamespaceL(const TDesC8 &, const TDesC8 &)
Method for adding a namespace for the Element.
-
Since
-
Series60 3.0
AddNamespaceL(CSenNamespace &, TBool)
Adds a namespace declaration. If this element (or its parent if parameter aCheckInParent is ETrue) already has a namespace with the same prefix and URI the given namespace is not added.
-
Since
-
Series60 3.0
AsElement()
Offers the M-class interface pointer to this XML element.
-
Since
-
Series60 3.0
AsXmlL()
HBufC8
*
|
AsXmlL
|
(
|
)
|
[pure virtual]
|
Gets the element as an XML buffer. Buffer will contain all the child elements.
-
Since
-
Series60 3.0
AsXmlUnicodeL()
HBufC
*
|
AsXmlUnicodeL
|
(
|
)
|
[pure virtual]
|
Gets the element as an unicode (UCS2) XML buffer. Buffer will contain all the child elements.
-
Since
-
Series60 3.0
AttrValue(const TDesC8 &)
const
TDesC8
*
|
AttrValue
|
(
|
const
TDesC8
&
|
aName
|
)
|
[pure virtual]
|
Gets the value of the given attribute.
-
Since
-
Series60 3.0
AttributesL()
Gets all the attributes of this element in an array.
-
Since
-
Series60 3.0
Child(TInt)
Gets a child element from a specified index.
-
Since
-
Series60 3.0
ConsistsOfL(MSenElement &)
Checks if element matches to another element by it's content and child elements. Element can contain more data than the given pattern.
-
Since
-
Series60 3.0
Parameters
MSenElement
& aCandidate
|
The pattern to be matched. Must contain same or less data for match to come true.
|
Content()
TPtrC8
|
Content
|
(
|
)
|
const [pure virtual]
|
Getter for the content of the element.
-
Since
-
Series60 3.0
ContentUnicodeL()
HBufC
*
|
ContentUnicodeL
|
(
|
)
|
const [pure virtual]
|
Getter for the content of the element, Unicode (UCS2) version
-
Since
-
Series60 3.0
ContentWriteStreamL()
Gets the write stream for the content for easy appending. Writing 8-bit (UTF-8) string to the returned stream will be appended to the content.
-
Since
-
Series60 3.0
CopyFromL(CSenElement &)
void
|
CopyFromL
|
(
|
CSenElement
&
|
aSource
|
)
|
[pure virtual]
|
Copies content from given element to this element appending to the existing content if there is any.
-
Since
-
Series60 3.0
CreateElementL(const TDesC8 &, const TDesC8 &)
Create a new element ready for adding or insertion. If the given namespace prefix is not declared yet the element will not be created and NULL will be returned.
-
Since
-
Series60 3.0
DetachL()
Detach the element from its parent. If the element, or one of its children, is dependent on a namespace declared in the scope of the parent copy those namespace declarations to this element.
-
Since
-
Series60 3.0
Element(const TDesC8 &)
Gets the child element with the specified local name. Assumes that namespace is the same as this parent element.
-
Since
-
Series60 3.0
Parameters
const
TDesC8
& aLocalName
|
is the XML localname of the requested child element
|
Element(const TDesC8 &, const TDesC8 &)
Gets the child element with the specified local name and namespace URI.
-
Since
-
Series60 3.0
Parameters
const
TDesC8
& aNsUri
|
is the XML namespace of the requested child element
|
const
TDesC8
& aLocalName
|
is the XML localname of the requested child element
|
ElementsL(RPointerArray< CSenElement > &, const TDesC8 &, const TDesC8 &)
Get a list of direct children element that have the given name and namespace.
-
Since
-
Series60 3.0
ElementsL(RPointerArray< CSenElement > &, const TDesC8 &)
Get a list of direct children element that have the given name and same namespace as this parent Element.
-
Since
-
Series60 3.0
HasContent()
TBool
|
HasContent
|
(
|
)
|
const [pure virtual]
|
Method for checking if the element has any content within.
-
Since
-
Series60 3.0
InsertElementL(CSenElement &, const CSenElement &)
Insert an Element into the list of children elements so that the inserted Element is placed right before the aBeforeElement. If aBeforeElement is not found, element will be appended to the last position. Function leaves if error occurs in inserting.
-
Since
-
Series60 3.0
Parameters
CSenElement
& aInsertedElement
|
the element to be inserted. Ownership is transferred.
|
const
CSenElement
& aBeforeElement
|
the element which will be right next to the element just inserted.
|
LocalName()
const
TDesC8
&
|
LocalName
|
(
|
)
|
const [pure virtual]
|
Getter for local name.
-
Since
-
Series60 3.0
Namespace()
Getter for Element's namespace.
-
Since
-
Series60 3.0
Namespace(const TDesC8 &)
Namespace(const TDesC8 &, const TDesC8 &)
Get namespace that is declared for the given prefix and namespace URI within the scope of this element.
-
Since
-
Series60 3.0
Parameters
const
TDesC8
& aNsPrefix
|
The prefix used to search
|
const
TDesC8
& aUri
|
The namespace URI used to search.
|
Namespace(const TDesC8 &, const TBool)
Parameters
const
TDesC8
& aNsPrefix
|
The prefix used to search
|
const
TBool
aCheckInParent
|
The flag indicating whether to check parent's namespaces too if not found in the current element. ETrue to check, EFalse for not to check.
|
NamespaceURI()
const
TDesC8
&
|
NamespaceURI
|
(
|
)
|
const [pure virtual]
|
Getter for namespace URI.
-
Since
-
Series60 3.0
NamespacesL()
Gets all the namespaces of this element in an array.
-
Since
-
Series60 3.0
NsPrefix()
const
TDesC8
&
|
NsPrefix
|
(
|
)
|
const [pure virtual]
|
Getter for namespace prefix of this element.
-
Since
-
Series60 3.0
Parent()
Gets the parent element of this element.
-
Since
-
Series60 3.0
RemoveElement(CSenElement &)
Remove an element from the childs.
-
Since
-
Series60 3.0
RemoveElement(const TDesC8 &, const TDesC8 &)
Remove an element from the childs.
-
Since
-
Series60 3.0
RemoveElement(const TDesC8 &)
Remove a child element.
-
Since
-
Series60 3.0
The caller takes ownership of the removed element.
ReplaceElementL(CSenElement &)
Replaces a child element with another element. Element's local name and namespace URI will be used to check whether or not that element matches with any existing child. If no matching child element is found this method will add a new child element.
Root()
Gets the root element. If no parent element, returns this element.
-
Since
-
Series60 3.0
Set(const TDesC8 &, const TDesC8 &, const TDesC8 &)
void
|
Set
|
(
|
const
TDesC8
&
|
aNamespaceURI,
|
|
const
TDesC8
&
|
aLocalName,
|
|
const
TDesC8
&
|
aQName
|
|
)
|
[pure virtual]
|
(Re-) Set the name and namespace of this Element. The element will be given the localName in the the given namespace. A prefix will be computed from the qualified name. This method should be used with care and is mainly intended for protected use in implementations.
-
Since
-
Series60 3.0
Parameters
const
TDesC8
& aNamespaceURI
|
The new namespace URI.
|
const
TDesC8
& aLocalName
|
The new local name.
|
const
TDesC8
& aQName
|
The new qualified name.
|
SetContentL(const TDesC8 &)
TPtrC8
|
SetContentL
|
(
|
const
TDesC8
&
|
aContent
|
)
|
[pure virtual]
|
Sets the content to the element. Old content is overwritten.
-
Since
-
Series60 3.0
Parameters
const
TDesC8
& aContent
|
The content to be set. Can be KNullDesC8.
|
SetNamespaceL(const TDesC8 &)
void
|
SetNamespaceL
|
(
|
const
TDesC8
&
|
aNsUri
|
)
|
[pure virtual]
|
Setter for Element's namespace URI.
-
Since
-
Series60 3.0
SetNamespaceL(const TDesC8 &, const TDesC8 &)
void
|
SetNamespaceL
|
(
|
const
TDesC8
&
|
aNsPrefix,
|
|
const
TDesC8
&
|
aNsUri
|
|
)
|
[pure virtual]
|
Setter for Element's namespace URI.
-
Since
-
Series60 3.0
SetParent(CSenElement *)
From
MSenElement
Sets the parent element to this element. Notice that the element is not automatically added as a child of the parent. Parent's
AddElementL()
must be called to achieve that.
SetPrefixL(const TDesC8 &)
void
|
SetPrefixL
|
(
|
const
TDesC8
&
|
aPrefix
|
)
|
[pure virtual]
|
Setter for namespace prefix of this element.
-
Since
-
Series60 3.0
WriteAsXMLToL(RWriteStream &)
void
|
WriteAsXMLToL
|
(
|
RWriteStream
&
|
aWriteStream
|
)
|
[pure virtual]
|
Element writes itself to a write stream using UTF-8 character-set encoding.
-
Since
-
Series60 3.0
WriteNamespacesToL(RWriteStream &)
void
|
WriteNamespacesToL
|
(
|
RWriteStream
&
|
aWriteStream
|
)
|
[pure virtual]
|
Element writes its namespaces to a write stream using UTF-8 character-set encoding.
-
Since
-
Series60 3.0
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.