CSenBaseElement Class Reference

API published in: S60 3rd Ed

Link against: senxml.lib

Capability Information

Required Capabilities

None


#include <senbaseelement.h>

Inherits CSenElement.

Inherited by CSenFacet, and CSenSoapFault.


Detailed Description

Implementation of an XML element functionality Content is stored in UTF-8 form XML.

Note, that setting any 8-bit content into XML without encoding it into form of legal is illegal. Instead, one should use encoding methods, like ones introduced in SenXmlUtils class to encode basic entities, or use use some other encoding like MD5 for binary data content.


Public Member Functions

virtual IMPORT_C  ~CSenBaseElement ()
  Destructor.
virtual IMPORT_C void  SetAttributesL (const RAttributeArray &apAttrs)
  Adds attributes to the element.
virtual IMPORT_C const TDesC8 &  LocalName () const
  Getter for Element's local name.
virtual IMPORT_C const TDesC8 &  NamespaceURI () const
  Getter for Element's namespace URI.
virtual IMPORT_C const TDesC8 &  NsPrefix () const
  Getter for namespace prefix of this element.
virtual IMPORT_C void  SetPrefixL (const TDesC8 &aPrefix)
  Setter for namespace prefix of this element.
virtual IMPORT_C TBool  HasContent () const
  Method for checking if the element has any content within.
virtual IMPORT_C TPtrC8  Content () const
  Getter for the content of the element.
virtual IMPORT_C HBufC *  ContentUnicodeL () const
  Getter for the content of the element, unicode version.
virtual IMPORT_C TPtrC8  SetContentL (const TDesC8 &aContent)
  Sets the content to the element.
virtual IMPORT_C RWriteStream &  ContentWriteStreamL ()
  Gets the write stream for the content for easy appending.
virtual IMPORT_C TBool  ConsistsOfL (MSenElement &aCandidate)
  Checks if element matches to another element by its content and child elements.
virtual IMPORT_C void  SetNamespaceL (const TDesC8 &aNsUri)
  Setter for Element's namespace URI.
virtual IMPORT_C void  SetNamespaceL (const TDesC8 &aNsPrefix, const TDesC8 &aNsUri)
  Setter for Element's namespace URI.
virtual IMPORT_C const CSenNamespace AddNamespaceL (CSenNamespace &aNewNamespace, TBool aCheckInParent)
  Adds a namespace declaration.
virtual IMPORT_C const CSenNamespace AddNamespaceL (const TDesC8 &aPrefix, const TDesC8 &aUri)
  Method for adding a namespace for the Element.
virtual IMPORT_C const CSenNamespace Namespace ()
  Getter for Element's namespace.
virtual IMPORT_C const CSenNamespace Namespace (const TDesC8 &aNsPrefix)
virtual IMPORT_C const CSenNamespace Namespace (const TDesC8 &aNsPrefix, const TBool aCheckInParent)
virtual IMPORT_C const CSenNamespace Namespace (const TDesC8 &aNsPrefix, const TDesC8 &aUri)
virtual IMPORT_C TInt  ElementsL (RPointerArray< CSenElement > &aElementArray, const TDesC8 &aNsUri, const TDesC8 &aLocalName)
  Getting the child elements of this element matching the given criteria.
virtual IMPORT_C TInt  ElementsL (RPointerArray< CSenElement > &aElementArray, const TDesC8 &aLocalName)
  Getting the child elements of this element matching the given criteria.
virtual IMPORT_C RPointerArray<
CSenElement > & 
ElementsL ()
  Getting the child elements of this element.
virtual IMPORT_C RPointerArray<
CSenBaseAttribute > & 
AttributesL ()
  Gets all the attributes of this element in an array.
virtual IMPORT_C RPointerArray<
CSenNamespace > & 
NamespacesL ()
  Gets all the namespaces of this element in an array.
virtual IMPORT_C const TDesC8 *  AttrValue (const TDesC8 &aName)
  Gets the value of the given attribute.
virtual IMPORT_C void  AddAttrL (const TDesC8 &aName, const TDesC8 &aValue)
  Adds an attribute.
virtual IMPORT_C CSenElement Parent ()
  Gets the parent element of this element.
virtual IMPORT_C CSenElement SetParent (CSenElement *apParent)
  Sets the parent element to this element.
virtual IMPORT_C MSenElement Root ()
  Gets the root element.
virtual IMPORT_C CSenElement Element (const TDesC8 &aLocalName)
  Gets the child element with the specified local name.
virtual IMPORT_C CSenElement Element (const TDesC8 &aNsUri, const TDesC8 &aLocalName)
  Gets the child element with the specified local name and namespace URI.
virtual IMPORT_C CSenElement CreateElementL (const TDesC8 &aNsPrefix, const TDesC8 &aLocalName)
  Create a new element ready for adding or insertion.
virtual IMPORT_C CSenElement InsertElementL (CSenElement &aElement, const CSenElement &aBeforeElement)
  Insert an Element into the list of children elements so that the inserted Element is placed right before the aBeforeElement.
virtual IMPORT_C CSenElement AddElementL (CSenElement &aElement)
  Adds an Element to the children elements.
virtual IMPORT_C CSenElement AddElementL (const TDesC8 &aNsUri, const TDesC8 &aLocalName)
  Constructs and adds a new element to the children elements.
virtual IMPORT_C CSenElement AddElementL (const TDesC8 &aNsUri, const TDesC8 &aLocalName, const TDesC8 &aQName)
  Constructs and adds a new element to the children elements.
virtual IMPORT_C CSenElement AddElementL (const TDesC8 &aLocalName)
  Constructs and adds a new element to the children elements.
virtual IMPORT_C CSenElement RemoveElement (CSenElement &aElement)
  Remove an element from the childs.
virtual IMPORT_C CSenElement RemoveElement (const TDesC8 &aNsUri, const TDesC8 &aLocalName)
  Remove an element from the childs.
virtual IMPORT_C CSenElement RemoveElement (const TDesC8 &aLocalName)
  Remove an element from the childs.
virtual IMPORT_C CSenElement ReplaceElementL (CSenElement &aElement)
  Replaces an element from the childs with another element.
virtual IMPORT_C HBufC8 *  AsXmlL ()
  Gets the element as an XML buffer.
virtual IMPORT_C HBufC *  AsXmlUnicodeL ()
  Gets the element as an unicode XML buffer.
virtual IMPORT_C void  WriteAsXMLToL (RWriteStream &aWriteStream)
  Element writes itself to a write stream using UTF-8 charset encoding.
virtual IMPORT_C void  WriteNamespacesToL (RWriteStream &aWriteStream)
  Element writes its namespaces to a write stream using UTF-8 charset encoding.
virtual IMPORT_C MSenElement AsElement ()
  Gets the current element as XML element.
IMPORT_C void  CopyFromL (CSenElement &aSource)
  Copies content from given element to this element appending to the existing content if there is any.
virtual IMPORT_C CSenElement DetachL ()
  Detach the element from its parent.
virtual IMPORT_C CSenElement Child (TInt aIndex)
  Gets a child element from a specified index.
virtual IMPORT_C void  Set (const TDesC8 &aNsUri, const TDesC8 &aLocalName, const TDesC8 &aQName)
  (Re-) Set the name and namespace of this Element.
virtual IMPORT_C void  AddAttributesL (const RAttributeArray &apAttrs)
  Adds new attributes to the element.

Static Public Member Functions

static IMPORT_C CSenBaseElement NewL (const TDesC8 &aLocalName)
  Standard constructor.
static IMPORT_C CSenBaseElement NewL (const TDesC8 &aNsUri, const TDesC8 &aLocalName)
  Standard constructor.
static IMPORT_C CSenBaseElement NewL (const TDesC8 &aNsUri, const TDesC8 &aLocalName, const TDesC8 &aQName)
  Standard constructor.
static IMPORT_C CSenBaseElement NewL (const TDesC8 &aNsUri, const TDesC8 &aLocalName, const TDesC8 &aQName, const RAttributeArray &apAttrs)
  Standard constructor.
static IMPORT_C CSenBaseElement NewL (const TDesC8 &aNsUri, const TDesC8 &aLocalName, const TDesC8 &aQName, const RAttributeArray &apAttrs, CSenElement &aParent)
  Standard constructor.

Protected Member Functions

IMPORT_C  CSenBaseElement ()
  C++ default constructor.
IMPORT_C void  BaseConstructL (const TDesC8 &aLocalName)
  Following BaseConstructL methods should be called from the deriving classes ConstructL() methods.
IMPORT_C void  BaseConstructL (const TDesC8 &aNsUri, const TDesC8 &aLocalName)
IMPORT_C void  BaseConstructL (const TDesC8 &aNsUri, const TDesC8 &aLocalName, const TDesC8 &aQName)
IMPORT_C void  BaseConstructL (const TDesC8 &aNsUri, const TDesC8 &aLocalName, const TDesC8 &aQName, const RAttributeArray &apAttrs)
IMPORT_C void  BaseConstructL (const TDesC8 &aNsUri, const TDesC8 &aLocalName, const TDesC8 &aQName, const RAttributeArray &apAttrs, CSenElement &aParent)
virtual IMPORT_C CSenBaseAttribute FindAttr (const TDesC8 &aName)
  Method for finding an attribute with given name.
virtual IMPORT_C TInt  IndexOfElement (const TDesC8 &aNsUri, const TDesC8 &aLocalName) const
  Method for finding index for a wanted element.
virtual IMPORT_C void  WriteAttrsToL (RWriteStream &aWriteStream)
  Writes element's attributes into a writestream.
virtual IMPORT_C void  WriteAttrToL (RWriteStream &aWriteStream, const TDesC8 &aName, const TDesC8 &aValue)
  Helper function to write an attribute into a writestream.
virtual IMPORT_C void  WriteElementsToL (RWriteStream &aWriteStream)
  Writes all internal elements into a writestream.
virtual IMPORT_C void  WriteContentToL (RWriteStream &aWriteStream)
  Writes all element's content into a writestream.
virtual IMPORT_C const TDesC8 &  AddAttributeL (const TDesC8 &aQName, const TDesC8 &aLocalName, const TDesC8 &aValue)
  Adds an attribute into this element.
virtual IMPORT_C const TDesC8 &  AddAttributeL (const TDesC8 &aAttrName, const TDesC8 &aValue)
  Adds an attribute into this element.
IMPORT_C const TDesC8 &  AddAttributeL (CSenBaseAttribute *apAttribute)
  Adds an attribute into this element.
virtual IMPORT_C void  AllocContentBufL ()
  Allocates a new buffer for saving content, if none allocated yet.
virtual IMPORT_C TPtrC8  WriteToBufL (CBufBase &aBuf)
  Writes element into a dynamic buffer.

Constructor & Destructor Documentation

virtual IMPORT_C CSenBaseElement::~CSenBaseElement  )  [virtual]
 

Destructor.

IMPORT_C CSenBaseElement::CSenBaseElement  )  [protected]
 

C++ default constructor.


Member Function Documentation

IMPORT_C const TDesC8& CSenBaseElement::AddAttributeL CSenBaseAttribute apAttribute  )  [protected]
 

Adds an attribute into this element.

Parameters:
apAttribute  Attribute to be added. Ownership is transferred to this element.
Returns:
attribute value as a string (TDesC8&)
virtual IMPORT_C const TDesC8& CSenBaseElement::AddAttributeL const TDesC8 &  aAttrName,
const TDesC8 &  aValue
[protected, virtual]
 

Adds an attribute into this element.

Used also adding new namespaces into the element.

Parameters:
aLocalName  Attribute's local name
aValue  Attribute's value
Returns:
value of the attribute as string (TDesC&) Leave codes: KErrSenInvalidCharacters if aLocalName contains illegal characters. KErrSenZeroLengthDescriptor if aAttrName is zero length, or if the local name part of it is zero length.
virtual IMPORT_C const TDesC8& CSenBaseElement::AddAttributeL const TDesC8 &  aQName,
const TDesC8 &  aLocalName,
const TDesC8 &  aValue
[protected, virtual]
 

Adds an attribute into this element.

Used also adding new namespaces into the element.

Parameters:
aQName  Attribute's qualified name
aLocalName  Attribute's local name
aValue  Attribute's value
Returns:
value of the attribute as string (TDesC&) Leave codes: KErrSenInvalidCharacters if aLocalName or aQName contain illegal characters. KErrSenZeroLengthDescriptor if aLocalName or aQName is zero length.
virtual IMPORT_C void CSenBaseElement::AddAttributesL const RAttributeArray &  apAttrs  )  [virtual]
 

Adds new attributes to the element.

Parameters:
aAttrs,:  the array of attributes.

Implements CSenElement.

virtual IMPORT_C void CSenBaseElement::AddAttrL const TDesC8 &  aName,
const TDesC8 &  aValue
[virtual]
 

Adds an attribute.

If attribute is already existing, the value of the attribute will be replaced.

Implements CSenElement.

virtual IMPORT_C CSenElement& CSenBaseElement::AddElementL const TDesC8 &  aLocalName  )  [virtual]
 

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.

Parameters:
aLocalName,:  local name of the new element
Returns:
the added Element Leave codes: KErrSenInvalidCharacters if aLocalName contains illegal characters. KErrSenZeroLengthDescriptor if aLocalName is zero length.

Implements CSenElement.

virtual IMPORT_C CSenElement& CSenBaseElement::AddElementL const TDesC8 &  aNsUri,
const TDesC8 &  aLocalName,
const TDesC8 &  aQName
[virtual]
 

Constructs and adds a new element to the children elements.

Sets this element to be the new parent of the given element.

Parameters:
aNsUri,:  namespace URI of the new element
aLocalName,:  local name of the new element
aQName,:  qualified name of the new element
Returns:
the added Element Leave codes: KErrSenInvalidCharacters if aLocalName or aQName contain illegal characters. KErrSenZeroLengthDescriptor if aLocalName or aQName is zero length.

Implements CSenElement.

virtual IMPORT_C CSenElement& CSenBaseElement::AddElementL const TDesC8 &  aNsUri,
const TDesC8 &  aLocalName
[virtual]
 

Constructs and adds a new element to the children elements.

Sets this element to be the new parent of the given element.

Parameters:
aNsUri,:  namespace URI of the new element
aLocalName,:  local name of the new element
Returns:
the added Element Leave codes: KErrSenInvalidCharacters if aLocalName contains illegal characters. KErrSenZeroLengthDescriptor if aLocalName is zero length.

Implements CSenElement.

virtual IMPORT_C CSenElement& CSenBaseElement::AddElementL CSenElement aElement  )  [virtual]
 

Adds an Element to the children elements.

Sets this element to be the new parent of the given element.

Parameters:
aElement,:  the element to be added. Ownership is transferred.
Returns:
the added Element

Implements CSenElement.

virtual IMPORT_C const CSenNamespace* CSenBaseElement::AddNamespaceL const TDesC8 &  aPrefix,
const TDesC8 &  aUri
[virtual]
 

Method for adding a namespace for the Element.

Parameters:
aPrefix,:  Namespace prefix
aUri,:  Namespace URI
Returns:
the added Namespace, or the equivalent pre-existing one.

Implements CSenElement.

virtual IMPORT_C const CSenNamespace* CSenBaseElement::AddNamespaceL CSenNamespace aNewNamespace,
TBool  aCheckInParent
[virtual]
 

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.

Parameters:
aNewNamespace 
aCheckInParent 
Returns:
the added Namespace, or the equivalent pre-existing one.

Implements CSenElement.

virtual IMPORT_C void CSenBaseElement::AllocContentBufL  )  [protected, virtual]
 

Allocates a new buffer for saving content, if none allocated yet.

virtual IMPORT_C MSenElement* CSenBaseElement::AsElement  )  [virtual]
 

Gets the current element as XML element.

Mostly used to get the classes which implement this interface as an instance of this interface.

Returns:
the current object as element. Ownership is NOT transferred.

Implements CSenElement.

virtual IMPORT_C HBufC8* CSenBaseElement::AsXmlL  )  [virtual]
 

Gets the element as an XML buffer.

Buffer will contain all the childs etc.

Returns:
element as XML. Caller takes ownership.

Implements CSenElement.

virtual IMPORT_C HBufC* CSenBaseElement::AsXmlUnicodeL  )  [virtual]
 

Gets the element as an unicode XML buffer.

Buffer will contain all the childs etc.

Returns:
element as XML. Caller takes ownership.

Implements CSenElement.

virtual IMPORT_C RPointerArray<CSenBaseAttribute>& CSenBaseElement::AttributesL  )  [virtual]
 

Gets all the attributes of this element in an array.

Returns:
array of attributes. Array will be empty if element has no attributes.

Implements CSenElement.

virtual IMPORT_C const TDesC8* CSenBaseElement::AttrValue const TDesC8 &  aName  )  [virtual]
 

Gets the value of the given attribute.

Parameters:
aName,:  Name of the attribute in question.
Returns:
the value of the attribute, or NULL if not found. Ownership is NOT TRANSFERRED.

Implements CSenElement.

IMPORT_C void CSenBaseElement::BaseConstructL const TDesC8 &  aNsUri,
const TDesC8 &  aLocalName,
const TDesC8 &  aQName,
const RAttributeArray &  apAttrs,
CSenElement aParent
[protected]
 
IMPORT_C void CSenBaseElement::BaseConstructL const TDesC8 &  aNsUri,
const TDesC8 &  aLocalName,
const TDesC8 &  aQName,
const RAttributeArray &  apAttrs
[protected]
 
IMPORT_C void CSenBaseElement::BaseConstructL const TDesC8 &  aNsUri,
const TDesC8 &  aLocalName,
const TDesC8 &  aQName
[protected]
 
IMPORT_C void CSenBaseElement::BaseConstructL const TDesC8 &  aNsUri,
const TDesC8 &  aLocalName
[protected]
 
IMPORT_C void CSenBaseElement::BaseConstructL const TDesC8 &  aLocalName  )  [protected]
 

Following BaseConstructL methods should be called from the deriving classes ConstructL() methods.

Parameter info is found in the corresponding NewL-methods.

virtual IMPORT_C CSenElement* CSenBaseElement::Child TInt  aIndex  )  [virtual]
 

Gets a child element from a specified index.

Parameters:
aIndex,:  the index what to get
Returns:
child element from a current index. NULL if no child in given index is found

Implements CSenElement.

virtual IMPORT_C TBool CSenBaseElement::ConsistsOfL MSenElement aCandidate  )  [virtual]
 

Checks if element matches to another element by its content and child elements.

Element can contain more data than the given pattern.

Parameters:
aCandidate  The pattern to be matched. Must contain same or less data for match to come true.
Returns:
ETrue if content and possible children match exactly to given pattern. EFalse otherwise.

Implements CSenElement.

virtual IMPORT_C TPtrC8 CSenBaseElement::Content  )  const [virtual]
 

Getter for the content of the element.

Returns:
the content or KNullDesC if empty.

Implements CSenElement.

virtual IMPORT_C HBufC* CSenBaseElement::ContentUnicodeL  )  const [virtual]
 

Getter for the content of the element, unicode version.

Returns:
content as unicode. Ownership IS TRANSFERRED to the caller.

Implements CSenElement.

virtual IMPORT_C RWriteStream& CSenBaseElement::ContentWriteStreamL  )  [virtual]
 

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.

Returns:
reference to the RWriteStream.

Implements CSenElement.

IMPORT_C void CSenBaseElement::CopyFromL CSenElement aSource  )  [virtual]
 

Copies content from given element to this element appending to the existing content if there is any.

Parameters:
aSource,:  The source element.

Implements CSenElement.

virtual IMPORT_C CSenElement* CSenBaseElement::CreateElementL const TDesC8 &  aNsPrefix,
const TDesC8 &  aLocalName
[virtual]
 

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.

Parameters:
aNsPrefix,:  The namespace prefix
aLocalName,:  The new elements localname
Returns:
the new Element just created, or NULL if given prefix was not declared yet. Ownership is transferred to the caller. Leave codes: KErrSenInvalidCharacters if aLocalName contains illegal characters. KErrSenZeroLengthDescriptor if aLocalName or aQName is zero length.

Implements CSenElement.

virtual IMPORT_C CSenElement* CSenBaseElement::DetachL  )  [virtual]
 

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.

Returns:
this Element. Ownership IS TRANSFERRED to the caller.

Implements CSenElement.

virtual IMPORT_C CSenElement* CSenBaseElement::Element const TDesC8 &  aNsUri,
const TDesC8 &  aLocalName
[virtual]
 

Gets the child element with the specified local name and namespace URI.

Returns:
the child element or NULL if the child with the specified criterias is not found. Ownership is NOT transferred.

Implements CSenElement.

virtual IMPORT_C CSenElement* CSenBaseElement::Element const TDesC8 &  aLocalName  )  [virtual]
 

Gets the child element with the specified local name.

Assumes that namespace is the same as this parent element.

Returns:
the child element or NULL if the child with the specified local name is not found. Ownership is NOT transferred.

Implements CSenElement.

virtual IMPORT_C RPointerArray<CSenElement>& CSenBaseElement::ElementsL  )  [virtual]
 

Getting the child elements of this element.

Returns:
an array of child elements. This is an empty array if there are no children. Any modifications made on the returned array modify the element object.

Implements CSenElement.

virtual IMPORT_C TInt CSenBaseElement::ElementsL RPointerArray< CSenElement > &  aElementArray,
const TDesC8 &  aLocalName
[virtual]
 

Getting the child elements of this element matching the given criteria.

Parameters:
aElementArray,:  Array to be filled with the matching elements, or empty array if no matching found. Any modifications made on the returned items modify the real childs too.
aNsUri,:  namespace URI to be matched
aLocalName,:  local name to be matched
Returns:
KErrNone ok KErrNotFound No child elements exist.

Implements CSenElement.

virtual IMPORT_C TInt CSenBaseElement::ElementsL RPointerArray< CSenElement > &  aElementArray,
const TDesC8 &  aNsUri,
const TDesC8 &  aLocalName
[virtual]
 

Getting the child elements of this element matching the given criteria.

Parameters:
aElementArray,:  Array to be filled with the matching elements, or empty array if no matching found. Any modifications made on the returned items modify the real childs too.
aNsUri,:  namespace URI to be matched
aLocalName,:  local name to be matched
Returns:
KErrNone ok KErrNotFound No child elements exist.

Implements CSenElement.

virtual IMPORT_C CSenBaseAttribute* CSenBaseElement::FindAttr const TDesC8 &  aName  )  [protected, virtual]
 

Method for finding an attribute with given name.

Parameters:
aName  a name of the attribute to be searched for
Returns:
the 1st attribute with the name, or NULL. Ownership is not transferred.
virtual IMPORT_C TBool CSenBaseElement::HasContent  )  const [virtual]
 

Method for checking if the element has any content within.

Returns:
ETrue if has content, EFalse if not.

Implements CSenElement.

virtual IMPORT_C TInt CSenBaseElement::IndexOfElement const TDesC8 &  aNsUri,
const TDesC8 &  aLocalName
const [protected, virtual]
 

Method for finding index for a wanted element.

Parameters:
aNsUri  a namespace URI which needs to match
aLocalName  a local name which needs to match
Returns:
Index of the element with given characteristics. or KErrNotFound if none matching
virtual IMPORT_C CSenElement& CSenBaseElement::InsertElementL CSenElement aElement,
const CSenElement aBeforeElement
[virtual]
 

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.

Parameters:
aInsertedElement,:  the element to be inserted. Ownership is transferred.
aBeforeElement,:  the element which will be right next to the element just inserted.
Returns:
the inserted Element

Implements CSenElement.

virtual IMPORT_C const TDesC8& CSenBaseElement::LocalName  )  const [virtual]
 

Getter for Element's local name.

Returns:
Localname or KNullDesC if not set.

Implements CSenElement.

virtual IMPORT_C const CSenNamespace* CSenBaseElement::Namespace const TDesC8 &  aNsPrefix,
const TDesC8 &  aUri
[virtual]
 
Parameters:
aNsPrefix,:  The prefix used to search
aUri,:  The namespace URI used to search.
Returns:
the found Namespace that is declared for the given prefix and namespace URI within the scope of this Element or NULL if not found.

Implements CSenElement.

virtual IMPORT_C const CSenNamespace* CSenBaseElement::Namespace const TDesC8 &  aNsPrefix,
const TBool  aCheckInParent
[virtual]
 
Parameters:
aNsPrefix,:  The prefix used to search
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.
Returns:
the found Namespace that is declared for the given prefix and namespace URI within the scope of this Element or NULL if not found

Implements CSenElement.

virtual IMPORT_C const CSenNamespace* CSenBaseElement::Namespace const TDesC8 &  aNsPrefix  )  [virtual]
 
Parameters:
prefix 
Returns:
the found Namespace that is declared for the given prefix within the scope of this Element. If no such prefix is declared return null.

Implements CSenElement.

virtual IMPORT_C const CSenNamespace* CSenBaseElement::Namespace  )  [virtual]
 

Getter for Element's namespace.

Returns:
const pointer to the CSenNamespace object of this Element. NULL if not set.

Implements CSenElement.

virtual IMPORT_C RPointerArray<CSenNamespace>& CSenBaseElement::NamespacesL  )  [virtual]
 

Gets all the namespaces of this element in an array.

Returns:
array of namespaces. Array will be empty if element has no namespaces.

Implements CSenElement.

virtual IMPORT_C const TDesC8& CSenBaseElement::NamespaceURI  )  const [virtual]
 

Getter for Element's namespace URI.

Returns:
Namespace URI or KNullDesC if not set.

Implements CSenElement.

static IMPORT_C CSenBaseElement* CSenBaseElement::NewL const TDesC8 &  aNsUri,
const TDesC8 &  aLocalName,
const TDesC8 &  aQName,
const RAttributeArray &  apAttrs,
CSenElement aParent
[static]
 

Standard constructor.

Parameters:
aNsUri  the namespace URI for this element.
aLocalName  the local name for this element.
aQName  the qualified name for this element.
apAttrs  the attributes for this element.
aParent,:  the parent element for the new element Leave codes: KErrSenInvalidCharacters if aLocalName or aQName contains illegal characters. KErrSenZeroLengthDescriptor if aLocalName or aQName is zero length.
static IMPORT_C CSenBaseElement* CSenBaseElement::NewL const TDesC8 &  aNsUri,
const TDesC8 &  aLocalName,
const TDesC8 &  aQName,
const RAttributeArray &  apAttrs
[static]
 

Standard constructor.

Parameters:
aNsUri  the namespace URI for this element.
aLocalName  the local name for this element.
aQName  the qualified name for this element.
apAttrs  the attributes for this element. Leave codes: KErrSenInvalidCharacters if aLocalName or aQName contains illegal characters. KErrSenZeroLengthDescriptor if aLocalName or aQName is zero length.

Reimplemented in CSenFacet, and CSenSoapFault.

static IMPORT_C CSenBaseElement* CSenBaseElement::NewL const TDesC8 &  aNsUri,
const TDesC8 &  aLocalName,
const TDesC8 &  aQName
[static]
 

Standard constructor.

Parameters:
aNsUri  the namespace URI for this element.
aLocalName  the local name for this element.
aQName  the qualified name for this element. Leave codes: KErrSenInvalidCharacters if aLocalName or aQName contains illegal characters. KErrSenZeroLengthDescriptor if aLocalName or aQName is zero length.
static IMPORT_C CSenBaseElement* CSenBaseElement::NewL const TDesC8 &  aNsUri,
const TDesC8 &  aLocalName
[static]
 

Standard constructor.

Parameters:
aNsUri  the namespace URI for this element.
aLocalName  the local name for this element. Leave codes: KErrSenInvalidCharacters if aLocalName contains illegal characters. KErrSenZeroLengthDescriptor if aLocalName is zero length.
static IMPORT_C CSenBaseElement* CSenBaseElement::NewL const TDesC8 &  aLocalName  )  [static]
 

Standard constructor.

Parameters:
aLocalName  the local name for this element. Leave codes: KErrSenInvalidCharacters if aLocalName contains illegal characters. KErrSenZeroLengthDescriptor if aLocalName is zero length.
virtual IMPORT_C const TDesC8& CSenBaseElement::NsPrefix  )  const [virtual]
 

Getter for namespace prefix of this element.

Returns:
namespace prefix or KNullDesC if not set.

Implements CSenElement.

virtual IMPORT_C CSenElement* CSenBaseElement::Parent  )  [virtual]
 

Gets the parent element of this element.

Returns:
the parent element or NULL if no parent set. Ownership is NOT transferred to the caller.

Implements CSenElement.

virtual IMPORT_C CSenElement* CSenBaseElement::RemoveElement const TDesC8 &  aLocalName  )  [virtual]
 

Remove an element from the childs.

Parameters:
aLocalName,:  the local name of the element to be removed.
Returns:
The removed element. May be NULL if nothing was removed (if element was not found from the childs). The caller TAKES OWNERSHIP of the removed element.

Implements CSenElement.

virtual IMPORT_C CSenElement* CSenBaseElement::RemoveElement const TDesC8 &  aNsUri,
const TDesC8 &  aLocalName
[virtual]
 

Remove an element from the childs.

Parameters:
aNsUri,:  the namespace URI of the element to be removed.
aLocalName,:  the local name of the element to be removed.
Returns:
The removed element. May be NULL if nothing was removed (if element was not found from the childs). The caller TAKES OWNERSHIP of the removed element.

Implements CSenElement.

virtual IMPORT_C CSenElement* CSenBaseElement::RemoveElement CSenElement aElement  )  [virtual]
 

Remove an element from the childs.

Parameters:
aElement,:  the element to be removed.
Returns:
The removed element. May be NULL if nothing was removed (if element was not found from the childs). The caller TAKES OWNERSHIP of the removed element.

Implements CSenElement.

virtual IMPORT_C CSenElement* CSenBaseElement::ReplaceElementL CSenElement aElement  )  [virtual]
 

Replaces an element from the childs with another element.

Element's local name and namespace URI will be used to match the element to be replaced. If matching element is not found, will normally add the given element to the childs.

Parameters:
aElement,:  the element to be added. Ownership is transferred.
Returns:
The old element. May be NULL if nothing was replaced (if element was not found from the childs). The caller TAKES OWNERSHIP of the old element.

Implements CSenElement.

virtual IMPORT_C MSenElement& CSenBaseElement::Root  )  [virtual]
 

Gets the root element.

If no parent element, returns this element.

Returns:
the root of the tree. Ownership is NOT transferred.

Implements CSenElement.

virtual IMPORT_C void CSenBaseElement::Set const TDesC8 &  aNsUri,
const TDesC8 &  aLocalName,
const TDesC8 &  aQName
[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.

Parameters:
aNamespaceURI,:  The new namespace URI.
aLocalName,:  The new local name.
aQName,:  The new qualified name.

Implements CSenElement.

virtual IMPORT_C void CSenBaseElement::SetAttributesL const RAttributeArray &  apAttrs  )  [virtual]
 

Adds attributes to the element.

Calls internally AddAttributesL() Can be overridden to replace old attributes.

Parameters:
aAttrs,:  the array of attributes.
virtual IMPORT_C TPtrC8 CSenBaseElement::SetContentL const TDesC8 &  aContent  )  [virtual]
 

Sets the content to the element.

Old content is overwritten.

Parameters:
aContent,:  The content to be set. Can be KNullDesC8.
Returns:
The content of the element or KNullDesC8 if no content was set.

Implements CSenElement.

virtual IMPORT_C void CSenBaseElement::SetNamespaceL const TDesC8 &  aNsPrefix,
const TDesC8 &  aNsUri
[virtual]
 

Setter for Element's namespace URI.

Parameters:
aNsPrefix,:  Namespace prefix
aNsUri,:  Namespace URI

Implements CSenElement.

virtual IMPORT_C void CSenBaseElement::SetNamespaceL const TDesC8 &  aNsUri  )  [virtual]
 

Setter for Element's namespace URI.

Parameters:
aNsUri,:  Namespace URI

Implements CSenElement.

virtual IMPORT_C CSenElement* CSenBaseElement::SetParent CSenElement apParent  )  [virtual]
 

Sets the parent element to this element.

Notice that the element is not automatically added as a child of the parent. Parent's AddElementL() should be called instead.

Parameters:
apParent,:  The wanted parent. Can be NULL.
Returns:
the parent element

Implements CSenElement.

virtual IMPORT_C void CSenBaseElement::SetPrefixL const TDesC8 &  aPrefix  )  [virtual]
 

Setter for namespace prefix of this element.

Parameters:
aPrefix,:  new namespace prefix for the element.

Implements CSenElement.

virtual IMPORT_C void CSenBaseElement::WriteAsXMLToL RWriteStream &  aWriteStream  )  [virtual]
 

Element writes itself to a write stream using UTF-8 charset encoding.

Parameters:
aWriteStream,:  The stream to write to.

Implements CSenElement.

virtual IMPORT_C void CSenBaseElement::WriteAttrsToL RWriteStream &  aWriteStream  )  [protected, virtual]
 

Writes element's attributes into a writestream.

Parameters:
aWriteStream  writestream to write into
virtual IMPORT_C void CSenBaseElement::WriteAttrToL RWriteStream &  aWriteStream,
const TDesC8 &  aName,
const TDesC8 &  aValue
[protected, virtual]
 

Helper function to write an attribute into a writestream.

Parameters:
aWriteStream  writestream to write into
aName  attribute name
aValue  attribute value
virtual IMPORT_C void CSenBaseElement::WriteContentToL RWriteStream &  aWriteStream  )  [protected, virtual]
 

Writes all element's content into a writestream.

Parameters:
aWriteStream  writestream to write into
virtual IMPORT_C void CSenBaseElement::WriteElementsToL RWriteStream &  aWriteStream  )  [protected, virtual]
 

Writes all internal elements into a writestream.

Parameters:
aWriteStream  writestream to write into
virtual IMPORT_C void CSenBaseElement::WriteNamespacesToL RWriteStream &  aWriteStream  )  [virtual]
 

Element writes its namespaces to a write stream using UTF-8 charset encoding.

Parameters:
aWriteStream,:  The stream to write to.

Implements CSenElement.

virtual IMPORT_C TPtrC8 CSenBaseElement::WriteToBufL CBufBase &  aBuf  )  [protected, virtual]
 

Writes element into a dynamic buffer.

Parameters:
aBuf  a dynamic buffer where to append everything.
Returns:
the modified buffer as TPtrC8.

The documentation for this class was generated from the following file:

Copyright © Nokia Corporation 2001-2008
Back to top