CSenFragment Class Reference

API published in: S60 3rd Ed

Link against: senxml.lib

Capability Information

Required Capabilities

None


#include <senfragment.h>

Inherits MSenFragment.

Inherited by CSenBaseFragment.


Detailed Description

Abstract base class declaring XML fragment interface.

Public Member Functions

virtual CSenElement AsElement ()=0
  Getting the fragment as an XML element.
virtual CSenElement ExtractElement ()=0
virtual void  SetReader (CSenXmlReader &aReader)=0
  Sets the XML reader to be used for parsing for the fragment.
virtual CSenXmlReader Reader ()=0
  Gets the XML reader which this fragment uses for parsing.
virtual void  ParseL (const TDesC8 &aBuf)=0
  Method to invoke parsing of a XML data.
virtual TInt  BuildFrom (const TDesC8 &aBuf)=0
  Same as ParseL() except that it doesn't leave in case of an error.
virtual void  DelegateParsingL (MSenFragment &aDelegate)=0
  Let the delegate MSenFragment handle the following SAX events.
virtual void  DelegateParsingL (const TDesC8 &aNsUri, const TDesC8 &aLocalName, const TDesC8 &aQName, const RAttributeArray &aAttrs)=0
  Creates a new fragment and lets the created MSenFragment handle the following SAX events.
virtual void  ParseWithL (CSenXmlReader &aReader)=0
  Sets the reader for this fragment and sets this to be the content handler of the following SAX events.
virtual void  SetOwner (MSenFragment &aFragment)=0
  Sets a new parent for this fragment.
virtual void  ResumeParsingFromL (const TDesC8 &aNsUri, const TDesC8 &aLocalName, const TDesC8 &aQName)=0
  Resumes the parsing.
virtual void  SetAttributesL (const RAttributeArray &aAttrs)=0
  Sets the attributes for the fragment.
virtual void  WriteStartElementL (const TDesC8 &aNsUri, const TDesC8 &aLocalName, const TDesC8 &aQName, const RAttributeArray &aAttrs)=0
  Writes the start element tag to the content stream.
virtual void  WriteEndElementL (const TDesC8 &aNsUri, const TDesC8 &aLocalName, const TDesC8 &aQName)=0
  Writes the end element tag to the content stream.
virtual const TDesC8 &  LocalName () const =0
  Getter for Fragment's local name.
virtual const TDesC8 &  NsUri () const =0
  Getter for Fragment's namespace URI.
virtual const TDesC8 &  NsPrefix () const =0
  Getter for namespace prefix of this fragment.
virtual void  WriteAsXMLToL (RWriteStream &aWriteStream)=0
  Fragment writes itself to a write stream using UTF-8 charset encoding.
virtual HBufC *  AsXmlUnicodeL ()=0
  Gets the fragment as an unicode XML buffer.
virtual HBufC8 *  AsXmlL ()=0
  Gets the fragment as an XML buffer.
virtual TPtrC8  Content ()=0
  Getter for the content.
virtual TBool  ConsistsOfL (MSenFragment &aCandidate)=0
  Checks if fragment matches to another fragment by its content and child elements.

Member Function Documentation

virtual CSenElement& CSenFragment::AsElement  )  [pure virtual]
 

Getting the fragment as an XML element.

This method will panic if element has not been initialized for any reason.

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

Implements MSenFragment.

Implemented in CSenBaseFragment.

virtual HBufC8* CSenFragment::AsXmlL  )  [pure virtual]
 

Gets the fragment as an XML buffer.

Buffer will contain all the childs etc.

Returns:
fragment as XML. Caller takes ownership.

Implements MSenFragment.

Implemented in CSenBaseFragment, and CSenXmlServiceDescription.

virtual HBufC* CSenFragment::AsXmlUnicodeL  )  [pure virtual]
 

Gets the fragment as an unicode XML buffer.

Buffer will contain all the childs etc.

Returns:
fragment as XML. Caller takes ownership.

Implements MSenFragment.

Implemented in CSenBaseFragment, and CSenXmlServiceDescription.

virtual TInt CSenFragment::BuildFrom const TDesC8 &  aBuf  )  [pure virtual]
 

Same as ParseL() except that it doesn't leave in case of an error.

Instead errors are trapped and error is returned. SetReader() must be called before this method can be used.

Returns:
KErrNone or other system-wide Symbian error codes.

Implements MSenFragment.

Implemented in CSenBaseFragment.

virtual TBool CSenFragment::ConsistsOfL MSenFragment aCandidate  )  [pure virtual]
 

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

Fragment can contain more data than the given candidate.

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 MSenFragment.

Implemented in CSenBaseFragment.

virtual TPtrC8 CSenFragment::Content  )  [pure virtual]
 

Getter for the content.

Returns content namespaces if there are any.

Returns:
Content.

Implemented in CSenBaseFragment.

virtual void CSenFragment::DelegateParsingL const TDesC8 &  aNsUri,
const TDesC8 &  aLocalName,
const TDesC8 &  aQName,
const RAttributeArray &  aAttrs
[pure virtual]
 

Creates a new fragment and lets the created MSenFragment handle the following SAX events.

This fragment is made the owner of the delegate and the delegate is expected to make this MSenFragment the receiver of SAX events once it has seen the end element for itself.

Parameters:
aNsUri,:  the namespace URI of the new delegate
aLocalName,:  the local name of the new delegate
aQName,:  the qualified name of the new delegate
aAttrs,:  the attributes which to be set for the new delegate

Implements MSenFragment.

Implemented in CSenBaseFragment.

virtual void CSenFragment::DelegateParsingL MSenFragment aDelegate  )  [pure virtual]
 

Let the delegate MSenFragment handle the following SAX events.

This fragment is made the owner of the delegate and the delegate is expected to make this MSenFragment the receiver of SAX events once it has seen the end element for itself.

Parameters:
aDelegate,:  the fragment to start handling the SAX events.

Implements MSenFragment.

Implemented in CSenBaseFragment.

virtual CSenElement* CSenFragment::ExtractElement  )  [pure virtual]
 
Returns:
the current object as element. May return NULL. Caller takes ownership.
Note(!): the return value (CSenElement) STRONGLY suggests that subclasses INHERIT CSenFragment in order properly comply the requirement of the ExtractElement() implementation.

Implements MSenFragment.

Implemented in CSenBaseFragment.

virtual const TDesC8& CSenFragment::LocalName  )  const [pure virtual]
 

Getter for Fragment's local name.

Returns:
Localname or KNullDesC if not set.

Implements MSenFragment.

Implemented in CSenBaseFragment.

virtual const TDesC8& CSenFragment::NsPrefix  )  const [pure virtual]
 

Getter for namespace prefix of this fragment.

Returns:
namespace prefix or KNullDesC if not set.

Implements MSenFragment.

Implemented in CSenBaseFragment.

virtual const TDesC8& CSenFragment::NsUri  )  const [pure virtual]
 

Getter for Fragment's namespace URI.

Returns:
Namespace URI or KNullDesC if not set.

Implements MSenFragment.

Implemented in CSenBaseFragment.

virtual void CSenFragment::ParseL const TDesC8 &  aBuf  )  [pure virtual]
 

Method to invoke parsing of a XML data.

Note: SetReader() must be called before this method can be used.

Parameters:
aBuf,:  The data to be parsed.

Implements MSenFragment.

Implemented in CSenBaseFragment.

virtual void CSenFragment::ParseWithL CSenXmlReader aReader  )  [pure virtual]
 

Sets the reader for this fragment and sets this to be the content handler of the following SAX events.

Parameters:
aReader,:  Reader to be used.

Implements MSenFragment.

Implemented in CSenBaseFragment, and CSenDomFragment.

virtual CSenXmlReader* CSenFragment::Reader  )  [pure virtual]
 

Gets the XML reader which this fragment uses for parsing.

Parameters:
aReader,:  the reader to be used. Ownerships is not transferred.

Implements MSenFragment.

Implemented in CSenBaseFragment.

virtual void CSenFragment::ResumeParsingFromL const TDesC8 &  aNsUri,
const TDesC8 &  aLocalName,
const TDesC8 &  aQName
[pure virtual]
 

Resumes the parsing.

Usually called by the delegate fragment which was parsing itself after DelegateParsingL().

Parameters:
aNsUri  The namespace URI of the current element
aLocalName  The local name of the current element
aQName  The qualified name of the current element

Implements MSenFragment.

Implemented in CSenBaseFragment, CSenDomFragment, and CSenXmlServiceDescription.

virtual void CSenFragment::SetAttributesL const RAttributeArray &  aAttrs  )  [pure virtual]
 

Sets the attributes for the fragment.

Parameters:
aAttrs,:  the array of attributes.

Implements MSenFragment.

Implemented in CSenBaseFragment, CSenDomFragment, and CSenXmlServiceDescription.

virtual void CSenFragment::SetOwner MSenFragment aFragment  )  [pure virtual]
 

Sets a new parent for this fragment.

Parameters:
aFragment,:  the new parent.

Implements MSenFragment.

Implemented in CSenBaseFragment.

virtual void CSenFragment::SetReader CSenXmlReader aReader  )  [pure virtual]
 

Sets the XML reader to be used for parsing for the fragment.

Parameters:
aReader,:  the reader to be used. Ownership is NOT transferred.

Implements MSenFragment.

Implemented in CSenBaseFragment.

virtual void CSenFragment::WriteAsXMLToL RWriteStream &  aWriteStream  )  [pure virtual]
 

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

Parameters:
aWriteStream,:  The stream to write to.

Implements MSenFragment.

Implemented in CSenBaseFragment, and CSenXmlServiceDescription.

virtual void CSenFragment::WriteEndElementL const TDesC8 &  aNsUri,
const TDesC8 &  aLocalName,
const TDesC8 &  aQName
[pure virtual]
 

Writes the end element tag to the content stream.

Derivants can override the basic usage used in BaseFragment.

Parameters:
aNsUri  The namespace URI of the current element
aLocalName  The local name of the current element
aQName  The qualified name of the current element

Implements MSenFragment.

Implemented in CSenBaseFragment, and CSenDomFragment.

virtual void CSenFragment::WriteStartElementL const TDesC8 &  aNsUri,
const TDesC8 &  aLocalName,
const TDesC8 &  aQName,
const RAttributeArray &  aAttrs
[pure virtual]
 

Writes the start element tag to the content stream.

Derivants can override the basic usage used in BaseFragment.

Parameters:
aNsUri  The namespace URI of the current element
aLocalName  The local name of the current element
aQName  The qualified name of the current element
aAttrs,:  the array of attributes.

Implements MSenFragment.

Implemented in CSenBaseFragment, and CSenDomFragment.


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

Copyright © Nokia Corporation 2001-2008
Back to top