CSenFragmentBase Class Reference
class CSenFragmentBase : public CBase |
Class implements basic functionality of an XML fragment Typically base fragment is used to parse certain part of some XML document. The element is identified by local name (or qualified name) and namespace. All child elements between start tag and and end tag defined this fragment will become content of this BaseFragment. In other words, BaseFragment has all data inside a single element. BaseFragment will parse only namespace (xmlns) attributes from a document and rest of the attributes are to be handled by subclasses, which should overwrite SetAttributesL() method to achieve this. The CSenFragmentReader class will do the actual parsing and this class will act as content handler for XML parser SAX events. SenFragment.dll
- Since
- Series60 4.0
Public Member Functions |
---|
| ~CSenFragmentBase() |
IMPORT_C RSenDocument & | AsDocumentL() |
IMPORT_C TXmlEngElement | AsElementL() |
IMPORT_C HBufC8 * | AsXmlL() |
IMPORT_C HBufC * | AsXmlUnicodeL() |
IMPORT_C TBool | ConsistsOfL(CSenFragmentBase &) |
IMPORT_C TPtrC8 | ContentL() |
IMPORT_C TXmlEngElement | ExtractElement() |
IMPORT_C TAny * | GetExtendedInterface(const TInt32) |
IMPORT_C TPtrC8 | LocalName() |
IMPORT_C TXmlEngNamespace | Namespace(const TDesC8 &) |
IMPORT_C CSenFragmentBase * | NewL(const TXmlEngElement &) |
IMPORT_C CSenFragmentBase * | NewL(const TDesC8 &) |
IMPORT_C CSenFragmentBase * | NewL(const TDesC8 &, const TDesC8 &) |
IMPORT_C CSenFragmentBase * | NewL(const TDesC8 &, const TDesC8 &, const TDesC8 &) |
IMPORT_C CSenFragmentBase * | NewL(const TDesC8 &, const TDesC8 &, const TDesC8 &, const RAttributeArray &) |
IMPORT_C CSenFragmentBase * | NewL(const TDesC8 &, const TDesC8 &, const TDesC8 &, const RAttributeArray &, TXmlEngElement &) |
IMPORT_C CSenFragmentBase * | NewL(const TDesC8 &, const TDesC8 &, const TDesC8 &, const RAttributeArray &, TXmlEngElement &, RSenDocument &) |
IMPORT_C CSenFragmentBase * | NewL(TXmlEngElement &, RSenDocument &) |
IMPORT_C TPtrC8 | NsPrefix() |
IMPORT_C TPtrC8 | NsUri() |
IMPORT_C void | OnContentL(const TDesC8 &, TInt) |
IMPORT_C void | OnDelegateParsingL(CSenFragmentBase &) |
IMPORT_C void | OnDelegateParsingL(const RTagInfo &, const RAttributeArray &, TInt) |
IMPORT_C void | OnEndDocumentL(TInt) |
IMPORT_C void | OnEndElementL(const RTagInfo &, TInt) |
IMPORT_C void | OnEndPrefixMappingL(const RString &, TInt) |
IMPORT_C void | OnError(TInt) |
IMPORT_C void | OnIgnorableWhiteSpaceL(const TDesC8 &, TInt) |
IMPORT_C void | OnProcessingInstructionL(const TDesC8 &, const TDesC8 &, TInt) |
IMPORT_C void | OnResumeParsingFromL(const RTagInfo &, TInt) |
IMPORT_C void | OnSkippedEntityL(const RString &, TInt) |
IMPORT_C void | OnStartDocumentL(const RDocumentParameters &, TInt) |
IMPORT_C void | OnStartElementL(const RTagInfo &, const RAttributeArray &, TInt) |
IMPORT_C void | OnStartPrefixMappingL(const RString &, const RString &, TInt) |
IMPORT_C void | OnWriteEndElementL(const RTagInfo &) |
IMPORT_C void | OnWriteStartElementL(const RTagInfo &, const RAttributeArray &) |
IMPORT_C void | ResetContentL() |
IMPORT_C void | SetContentHandler(CSenFragmentBase &) |
IMPORT_C void | SetDocument(RSenDocument &) |
IMPORT_C void | SetOwner(CSenFragmentBase &) |
IMPORT_C void | WriteAsXMLToL(RWriteStream &) |
Protected Member Functions |
---|
| CSenFragmentBase() |
IMPORT_C void | AddAttributesL(const RAttributeArray &) |
IMPORT_C void | AddAttributesToElementL(TXmlEngElement, const RAttributeArray &) |
IMPORT_C void | AddContentL(const TDesC8 &) |
IMPORT_C void | AddNamespacesL() |
IMPORT_C void | BaseConstructL(const TXmlEngElement &) |
IMPORT_C void | BaseConstructL(const TDesC8 &) |
IMPORT_C void | BaseConstructL(const TDesC8 &, const TDesC8 &) |
IMPORT_C void | BaseConstructL(const TDesC8 &, const TDesC8 &, const TDesC8 &) |
IMPORT_C void | BaseConstructL(const TDesC8 &, const TDesC8 &, const TDesC8 &, const RAttributeArray &) |
IMPORT_C void | BaseConstructL(const TDesC8 &, const TDesC8 &, const TDesC8 &, const RAttributeArray &, TXmlEngElement &) |
IMPORT_C void | BaseConstructL(const TDesC8 &, const TDesC8 &, const TDesC8 &, const RAttributeArray &, TXmlEngElement &, RSenDocument &) |
IMPORT_C void | BaseConstructL(TXmlEngElement &, RSenDocument &) |
IMPORT_C TBool | ConsistsOfL(TXmlEngElement &, TXmlEngElement &) |
IMPORT_C TPtrC8 | ContentOf(const TDesC8 &) |
void | RenameL(const TDesC8 &, const TDesC8 &, const TDesC8 &) |
void | RenameL(const TDesC8 &, const TDesC8 &) |
void | RenameLocalNameL(const TDesC8 &) |
void | RenameNamespaceL(const TDesC8 &) |
void | RenameNamespaceL(const TDesC8 &, const TDesC8 &) |
void | RenamePrefixL(const TDesC8 &) |
IMPORT_C void | SetContentL(const TDesC8 &) |
IMPORT_C TXmlEngElement | SetContentOfL(const TDesC8 &, const TDesC8 &) |
IMPORT_C void | StartSavingContent() |
Constructor & Destructor Documentation
CSenFragmentBase()
IMPORT_C | CSenFragmentBase | ( | ) | [protected] |
~CSenFragmentBase()
IMPORT_C | ~CSenFragmentBase | ( | ) | [virtual] |
Member Functions Documentation
AddAttributesL(const RAttributeArray &)
IMPORT_C void | AddAttributesL | ( | const RAttributeArray & | apAttrs | ) | [protected, virtual] |
Adds new XML attributes to this fragment. Can be overridden to replace old attributes.
AddAttributesToElementL(TXmlEngElement, const RAttributeArray &)
Adds new XML attributes to specified element. Can be overridden to replace old attributes.
AddContentL(const TDesC8 &)
IMPORT_C void | AddContentL | ( | const TDesC8 & | aContent | ) | [protected, virtual] |
Adds the content.
- Since
- Series60 4.0
Parameters
const TDesC8 & aContent | Content to be set. |
AddNamespacesL()
IMPORT_C void | AddNamespacesL | ( | ) | [protected, virtual] |
Adds namespaces from internal array for the fragment.
- Since
- Series60 4.0
AsDocumentL()
Returns the current XML element of this fragment. If element has not been set, this method will initialize new, un-initialized element. Method leaves with if there is not enough memory (OOM)
AsElementL()
Returns the current XML element of this fragment. If element has not been set, this method will initialize new, un-initialized element. Method leaves with if there is not enough memory (OOM)
AsXmlL()
IMPORT_C HBufC8 * | AsXmlL | ( | ) | [virtual] |
Gets the fragment data as an UTF-8 form XML.
- Since
- Series60 4.0
AsXmlUnicodeL()
IMPORT_C HBufC * | AsXmlUnicodeL | ( | ) | [virtual] |
Gets the fragment data as an unicode XML.
- Since
- Series60 4.0
BaseConstructL(const TXmlEngElement &)
Following BaseConstructL methods should be called from ConstructL() methods of some deriving (fragment) class. BaseConstructL, where an element is given as initializer.
- Since
- Series60 4.0
BaseConstructL(const TDesC8 &)
IMPORT_C void | BaseConstructL | ( | const TDesC8 & | aLocalName | ) | [protected] |
BaseConstructL setting XML localname for this fragment.
- Since
- Series60 4.0
Parameters
const TDesC8 & aLocalName | XML localname for this fragment |
BaseConstructL(const TDesC8 &, const TDesC8 &)
IMPORT_C void | BaseConstructL | ( | const TDesC8 & | aNsUri, |
| const TDesC8 & | aLocalName |
| ) | [protected] |
BaseConstructL offering possibility to set XML namespace and localname.
- Since
- Series60 4.0
Parameters
const TDesC8 & aNsUri | XML namespace URI for this fragment |
const TDesC8 & aLocalName | XML localname for this fragment |
BaseConstructL(const TDesC8 &, const TDesC8 &, const TDesC8 &)
IMPORT_C void | BaseConstructL | ( | const TDesC8 & | aNsUri, |
| const TDesC8 & | aLocalName, |
| const TDesC8 & | aPrefix |
| ) | [protected] |
Base constructor
- Since
- Series60 4.0
Parameters
const TDesC8 & aNsUri | XML namespace URI for this fragment |
const TDesC8 & aLocalName | XML localname for this fragment |
const TDesC8 & aPrefix | |
BaseConstructL(const TDesC8 &, const TDesC8 &, const TDesC8 &, const RAttributeArray &)
Base constructor
- Since
- Series60 4.0
Parameters
const TDesC8 & aNsUri | XML namespace URI for this fragment |
const TDesC8 & aLocalName | XML localname for this fragment |
const TDesC8 & aPrefix | |
const RAttributeArray & aAttrs | XML attributes for this fragment |
BaseConstructL(const TDesC8 &, const TDesC8 &, const TDesC8 &, const RAttributeArray &, TXmlEngElement &)
Base constructor
- Since
- Series60 4.0
Parameters
const TDesC8 & aNsUri | XML namespace URI for this fragment |
const TDesC8 & aLocalName | XML localname for this fragment |
const TDesC8 & aPrefix | |
const RAttributeArray & aAttrs | XML attributes for this fragment |
TXmlEngElement & aParent | parent to be set for this fragmemt |
BaseConstructL(const TDesC8 &, const TDesC8 &, const TDesC8 &, const RAttributeArray &, TXmlEngElement &, RSenDocument &)
Base constructor
- Since
- Series60 4.0
Parameters
const TDesC8 & aNsUri | XML namespace URI for this fragment |
const TDesC8 & aLocalName | XML localname for this fragment |
const TDesC8 & aPrefix | |
const RAttributeArray & aAttrs | XML attributes for this fragment |
TXmlEngElement & aParent | Parent to be set for this fragmemt |
RSenDocument & aOwnerDocument | The document which will be the owner of the elements of this fragment |
BaseConstructL(TXmlEngElement &, RSenDocument &)
Base constructor
- Since
- Series60 4.0
Parameters
TXmlEngElement & aRootElement | The element which will be the root element of this fragment |
RSenDocument & aOwnerDocument | The document which will be the owner of the elements of this fragment |
ConsistsOfL(CSenFragmentBase &)
Checks if fragment matches to another fragment by its content and child elements. Fragment can contain more data than the given candidate.
- Since
- Series60 4.0
Parameters
CSenFragmentBase & aCandidate | The pattern to be matched. Must contain same or less data for match to come true. |
ConsistsOfL(TXmlEngElement &, TXmlEngElement &)
ContentL()
IMPORT_C TPtrC8 | ContentL | ( | ) | [virtual] |
Getter for the content,which is returned as UTF-8 form XML.
- Since
- Series60 4.0
ContentOf(const TDesC8 &)
IMPORT_C TPtrC8 | ContentOf | ( | const TDesC8 & | aLocalName | ) | [protected] |
Gets the content of a given element.
- Since
- Series60 4.0
Parameters
const TDesC8 & aLocalName | The local name of the element which content is asked |
ExtractElement()
Etracts the XML element from the fragment, leaving the fragment empty. Note(!): the return value (CSenElement) STRONGLY suggests that subclasses INHERIT CSenFragment in order properly comply the requirement of the
ExtractElement() implementation.
- Since
- Series60 4.0
GetExtendedInterface(const TInt32)
IMPORT_C TAny * | GetExtendedInterface | ( | const TInt32 | aUid | ) | [virtual] |
Callback function implementing the XML content handler interface. Inheriting classes can override these.
- Since
- Series60 3.1
MContentHandler
LocalName()
IMPORT_C TPtrC8 | LocalName | ( | ) | const [virtual] |
Namespace(const TDesC8 &)
Gets the namespace object with a given prefix.
- Since
- Series60 4.0
NewL(const TXmlEngElement &)
Standard 2 phase constructor.
- Since
- Series60 4.0
Parameters
const TXmlEngElement & aElement | is the element where construction data will be copied from. |
NewL(const TDesC8 &)
Standard 2 phase constructor.
- Since
- Series60 4.0
NewL(const TDesC8 &, const TDesC8 &)
Standard 2 phase constructor.
- Since
- Series60 4.0
NewL(const TDesC8 &, const TDesC8 &, const TDesC8 &)
Standard 2 phase constructor.
- Since
- Series60 4.0
Parameters
const TDesC8 & aNsUri | XML namespace URI |
const TDesC8 & aLocalName | XML localname |
const TDesC8 & aPrefix | XML prefix |
NewL(const TDesC8 &, const TDesC8 &, const TDesC8 &, const RAttributeArray &)
Standard 2 phase constructor.
- Since
- Series60 4.0
NewL(const TDesC8 &, const TDesC8 &, const TDesC8 &, const RAttributeArray &, TXmlEngElement &)
Standard 2 phase constructor.
- Since
- Series60 4.0
NewL(const TDesC8 &, const TDesC8 &, const TDesC8 &, const RAttributeArray &, TXmlEngElement &, RSenDocument &)
Standard 2 phase constructor.
- Since
- Series60 4.0
NewL(TXmlEngElement &, RSenDocument &)
Standard 2 phase constructor.
- Since
- Series60 4.0
Parameters
TXmlEngElement & aRootElement | The element which will be the root element of this fragment. |
RSenDocument & aOwnerDocument | The document which will be the owner of the elements of this fragment |
NsPrefix()
IMPORT_C TPtrC8 | NsPrefix | ( | ) | const [virtual] |
Getter for namespace prefix of this fragment.
- Since
- Series60 4.0
NsUri()
IMPORT_C TPtrC8 | NsUri | ( | ) | const [virtual] |
Getter for Fragment's namespace URI..
- Since
- Series60 4.0
OnContentL(const TDesC8 &, TInt)
IMPORT_C void | OnContentL | ( | const TDesC8 & | aBytes, |
| TInt | aErrorCode |
| ) | [virtual] |
Callback function implementing the XML content handler interface. Inheriting classes can override these.
- Since
- Series60 3.1
MContentHandler
OnDelegateParsingL(CSenFragmentBase &)
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.
- Since
- Series60 4.0
OnDelegateParsingL(const RTagInfo &, const RAttributeArray &, TInt)
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 act as receiver for SAX events (callbacks) once it has seen the end element for itself.
- Since
- Series60 4.0
Parameters
const RTagInfo & aElement | The RTagInfo class holding information that describes the element. |
const RAttributeArray & aAttributes | The attributes of the new element |
TInt aErrorCode | Error code |
OnEndDocumentL(TInt)
IMPORT_C void | OnEndDocumentL | ( | TInt | aErrorCode | ) | [virtual] |
Callback function implementing the XML content handler interface. Inheriting classes can override these.
- Since
- Series60 3.1
MContentHandler
OnEndElementL(const RTagInfo &, TInt)
IMPORT_C void | OnEndElementL | ( | const RTagInfo & | aElement, |
| TInt | aErrorCode |
| ) | [virtual] |
Callback function implementing the XML content handler interface. Inheriting classes can override these.
- Since
- Series60 3.1
MContentHandler
OnEndPrefixMappingL(const RString &, TInt)
IMPORT_C void | OnEndPrefixMappingL | ( | const RString & | aPrefix, |
| TInt | aErrorCode |
| ) | [virtual] |
Callback function implementing the XML content handler interface. Inheriting classes can override these.
- Since
- Series60 3.1
MContentHandler
OnError(TInt)
IMPORT_C void | OnError | ( | TInt | aErrorCode | ) | [virtual] |
Callback function implementing the XML content handler interface. Inheriting classes can override these.
- Since
- Series60 3.1
MContentHandler
OnIgnorableWhiteSpaceL(const TDesC8 &, TInt)
IMPORT_C void | OnIgnorableWhiteSpaceL | ( | const TDesC8 & | aBytes, |
| TInt | ErrorCode |
| ) | [virtual] |
Callback function implementing the XML content handler interface. Inheriting classes can override these.
- Since
- Series60 3.1
MContentHandler
OnProcessingInstructionL(const TDesC8 &, const TDesC8 &, TInt)
IMPORT_C void | OnProcessingInstructionL | ( | const TDesC8 & | aTarget, |
| const TDesC8 & | aData, |
| TInt | aErrorCode |
| ) | [virtual] |
Callback function implementing the XML content handler interface. Inheriting classes can override these.
- Since
- Series60 3.1
MContentHandler
OnResumeParsingFromL(const RTagInfo &, TInt)
IMPORT_C void | OnResumeParsingFromL | ( | const RTagInfo & | aElement, |
| TInt | aErrorCode |
| ) | [virtual] |
Leave codes: Resumes parsing to be handled by this fragment. Usually called by some delegate fragment which was set to be content handler because this fragment called DelegateParsingL().
- Since
- Series60 4.0
Parameters
const RTagInfo & aElement | The RTagInfo class holding information that describes the element. |
TInt aErrorCode | Error code |
OnSkippedEntityL(const RString &, TInt)
IMPORT_C void | OnSkippedEntityL | ( | const RString & | aName, |
| TInt | aErrorCode |
| ) | [virtual] |
Callback function implementing the XML content handler interface. Inheriting classes can override these.
- Since
- Series60 3.1
MContentHandler
OnStartDocumentL(const RDocumentParameters &, TInt)
IMPORT_C void | OnStartDocumentL | ( | const RDocumentParameters & | aDocParam, |
| TInt | aErrorCode |
| ) | [virtual] |
Callback function implementing the XML content handler interface. Inheriting classes can override these.
- Since
- Series60 3.1
MContentHandler
Parameters
const RDocumentParameters & aDocParam | |
TInt aErrorCode | |
OnStartElementL(const RTagInfo &, const RAttributeArray &, TInt)
Callback function implementing the XML content handler interface. Inheriting classes can override these.
- Since
- Series60 3.1
MContentHandler
OnStartPrefixMappingL(const RString &, const RString &, TInt)
IMPORT_C void | OnStartPrefixMappingL | ( | const RString & | aPrefix, |
| const RString & | aUri, |
| TInt | aErrorCode |
| ) | [virtual] |
Callback function implementing the XML content handler interface. Inheriting classes can override these.
- Since
- Series60 3.1
MContentHandler
OnWriteEndElementL(const RTagInfo &)
IMPORT_C void | OnWriteEndElementL | ( | const RTagInfo & | aElement | ) | |
Writes the end element tag to the content stream. Derivants can override the basic usage used in BaseFragment.
- Since
- Series60 4.0
Parameters
const RTagInfo & aElement | The RTagInfo class holding information that describes the element. |
OnWriteStartElementL(const RTagInfo &, const RAttributeArray &)
Sets the attributes for the fragment. BaseFragment parses only namespace (xmlns) attributes from the document. Subclasses should override this method if they are intrested of handling any other XML attributes and their corresponding values.
- Since
- Series60 4.0
- Since
- Series60 4.0
Parameters
const RTagInfo & aElement | The RTagInfo class holding information that describes the element. |
const RAttributeArray & aAttributes | The attributes of the new element |
RenameL(const TDesC8 &, const TDesC8 &, const TDesC8 &)
void | RenameL | ( | const TDesC8 & | aLocalName, |
| const TDesC8 & | aPrefix, |
| const TDesC8 & | aNamespace |
| ) | [protected] |
Method renames the XML properties of this fragment.
Parameters
const TDesC8 & aLocalName | XML localname for this fragment |
const TDesC8 & aPrefix | XML namespace prefix for this fragment |
const TDesC8 & aNamespace | XML namespace URI for this fragment Method leaves with if there is not enough memory (OOM) |
RenameL(const TDesC8 &, const TDesC8 &)
void | RenameL | ( | const TDesC8 & | aLocalName, |
| const TDesC8 & | aNamespace |
| ) | [protected] |
Method renames the XML properties of this fragment.
Parameters
const TDesC8 & aLocalName | XML localname for this fragment |
const TDesC8 & aNamespace | XML namespace URI for this fragment Method leaves with if there is not enough memory (OOM) |
RenameLocalNameL(const TDesC8 &)
void | RenameLocalNameL | ( | const TDesC8 & | aLocalName | ) | [protected] |
Renames local name for this XML fragment.
Parameters
const TDesC8 & aLocalName | XML localname for this fragment Method leaves with if there is not enough memory (OOM) |
RenameNamespaceL(const TDesC8 &)
void | RenameNamespaceL | ( | const TDesC8 & | aNamespace | ) | [protected] |
Renames namespace URI for this XML fragment.
Parameters
const TDesC8 & aNamespace | XML namespace URI for this fragment Method leaves with if there is not enough memory(OOM) |
RenameNamespaceL(const TDesC8 &, const TDesC8 &)
void | RenameNamespaceL | ( | const TDesC8 & | aPrefix, |
| const TDesC8 & | aNamespace |
| ) | [protected] |
Renames namespace prefix and namespace URI for this XML fragment.
Parameters
const TDesC8 & aPrefix | XML namespace prefix for this fragment |
const TDesC8 & aNamespace | XML namespace URI for this fragment Method leaves with if there is not enough memory (OOM) |
RenamePrefixL(const TDesC8 &)
void | RenamePrefixL | ( | const TDesC8 & | aPrefix | ) | [protected] |
Renames namespace prefix for this XML fragment.
Parameters
const TDesC8 & aPrefix | XML namespace prefix for this fragment Method leaves with if there is not enough memory (OOM) |
ResetContentL()
IMPORT_C void | ResetContentL | ( | ) | [virtual] |
- Since
- Series60 4.0
- Since
- Series60 4.0
SetContentHandler(CSenFragmentBase &)
SetContentL(const TDesC8 &)
IMPORT_C void | SetContentL | ( | const TDesC8 & | aContent | ) | [protected, virtual] |
Sets content to a child element. If no element with given local name is not found, new one is added and content is set to that one.
- Since
- Series60 4.0
Parameters
const TDesC8 & aContent | Content to be set. |
SetContentOfL(const TDesC8 &, const TDesC8 &)
Sets content to a child element. If no element with given local name is not found, new one is added and content is set to that one.
- Since
- Series60 4.0
Parameters
const TDesC8 & aLocalName | The local name of element which content is about to be set |
const TDesC8 & aContent | Content to be set. |
SetDocument(RSenDocument &)
SetOwner(CSenFragmentBase &)
Sets a new parent for this fragment.
- Since
- Series60 4.0
SetParser(CSenParser &)
IMPORT_C void | SetParser | ( | CSenParser & | aParser | ) | [private, virtual] |
Sets the XML parser to be used for parsing for the fragment.
- Since
- Series60 4.0
StartSavingContent()
IMPORT_C void | StartSavingContent | ( | ) | [protected] |
StartSavingContent changes the internal SAX parsing state of this fragment to KSenStateSave, which means that next call to OnStartElementL is treated as data, and not ignored (in DOM fragment implementation, it would be "extended" into a DOM object).
WriteAsXMLToL(RWriteStream &)
Invokes AsElement().WriteAsXMLToL(aWs);
- Since
- Series60 4.0
Parameters
RWriteStream & aWs | is the stream into which the UTF-8 form XML will be written. |
Member Data Documentation
RBufWriteStream * ipContentWriteStream
CSenFragmentBase * ipDelegate
RPointerArray< CSenNamespaceData > * ipNamespaceArray
CSenFragmentBase * ipOwner
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.