XBinder XML Runtime
XBinder Version 3.0.x
|
OSXMLEncodeBase is a base class for the XML encode buffer and stream classes, OSXMLEncodeBuffer and OSXMLEncodeStream. More...
#include <OSXMLMessageBuffer.h>
Public Member Functions | |
EXTXMLMETHOD int | encodeAttr (const OSUTF8CHAR *name, const OSUTF8CHAR *value) |
This function encodes an attribute in which the name and value are given as null-terminated UTF-8 strings. More... | |
EXTXMLMETHOD int | encodeText (const OSUTF8CHAR *value) |
This method encodes XML textual content. More... | |
EXTXMLMETHOD int | endDocument () |
This method ends an XML document by flushing any remaining data to the stream. | |
EXTXMLMETHOD int | endElement (const OSUTF8CHAR *elemName, OSXMLNamespace *pNS=0) |
This method encodes an end element tag value (</elemName>). More... | |
EXTXMLMETHOD int | startDocument () |
This method writes information to start an XML document to the encode stream. More... | |
EXTXMLMETHOD int | startElement (const OSUTF8CHAR *elemName, OSXMLNamespace *pNS=0, OSRTDList *pNSAttrs=0, OSBOOL terminate=FALSE) |
This method writes information to start an XML element to the encode stream. More... | |
EXTXMLMETHOD int | termStartElement () |
This metod terminates a currently open XML start element by adding either a '>' or '/>' (if empty) terminator. More... | |
![]() | |
virtual EXTXMLMETHOD void * | getAppInfo () |
The getAppInfo method returns the pointer to application context information. | |
EXTXMLMETHOD int | getIndent () |
This method returns current XML output indent value. More... | |
EXTXMLMETHOD int | getIndentChar () |
This method returns current XML output indent character value (default is space). More... | |
EXTXMLMETHOD OSBOOL | getWriteBOM () |
This function returns whether writing the Unicode BOM is currently enabled or disabled. More... | |
virtual EXTXMLMETHOD void | setNamespace (const OSUTF8CHAR *prefix, const OSUTF8CHAR *uri, OSRTDList *pNSAttrs=0) |
This method sets a namespace in the context namespace list. More... | |
virtual EXTXMLMETHOD void | setAppInfo (void *pXMLInfo) |
This method sets application specific context information within the common context structure. More... | |
EXTXMLMETHOD void | setFormatting (OSBOOL doFormatting) |
This method sets XML output formatting to the given value. More... | |
EXTXMLMETHOD void | setIndent (OSUINT8 indent) |
This method sets XML output indent to the given value. More... | |
EXTXMLMETHOD void | setIndentChar (char indentChar) |
This method sets XML output indent character to the given value. More... | |
EXTXMLMETHOD void | setWriteBOM (OSBOOL write) |
This method sets whether to write the Unicode byte order mark before the XML header. More... | |
Protected Member Functions | |
EXTXMLMETHOD | OSXMLEncodeBase (OSRTContext *pContext=0) |
The protected constructor creates a new context and sets the buffer class type. More... | |
![]() | |
EXTXMLMETHOD | OSXMLMessageBuffer (Type bufferType, OSRTContext *pContext=0) |
The protected constructor creates a new context and sets the buffer class type. More... | |
OSXMLEncodeBase is a base class for the XML encode buffer and stream classes, OSXMLEncodeBuffer and OSXMLEncodeStream.
Definition at line 153 of file OSXMLMessageBuffer.h.
|
protected |
The protected constructor creates a new context and sets the buffer class type.
pContext | Pointer to a context to use. If NULL, new context will be allocated. |
EXTXMLMETHOD int OSXMLEncodeBase::encodeAttr | ( | const OSUTF8CHAR * | name, |
const OSUTF8CHAR * | value | ||
) |
This function encodes an attribute in which the name and value are given as null-terminated UTF-8 strings.
name | Attribute name. |
value | UTF-8 string value to be encoded. |
EXTXMLMETHOD int OSXMLEncodeBase::encodeText | ( | const OSUTF8CHAR * | value | ) |
This method encodes XML textual content.
XML metadata characters such as '<' are escaped. The input value is specified in UTF-8 character format but may be transformed if a different character encoding is enabled.
value | UTF-8 string value to be encoded. |
EXTXMLMETHOD int OSXMLEncodeBase::endElement | ( | const OSUTF8CHAR * | elemName, |
OSXMLNamespace * | pNS = 0 |
||
) |
This method encodes an end element tag value (</elemName>).
elemName | XML element name. |
pNS | XML namespace information (prefix and URI). |
EXTXMLMETHOD int OSXMLEncodeBase::startDocument | ( | ) |
This method writes information to start an XML document to the encode stream.
This includes the XML header declaration.
EXTXMLMETHOD int OSXMLEncodeBase::startElement | ( | const OSUTF8CHAR * | elemName, |
OSXMLNamespace * | pNS = 0 , |
||
OSRTDList * | pNSAttrs = 0 , |
||
OSBOOL | terminate = FALSE |
||
) |
This method writes information to start an XML element to the encode stream.
It can leave the element open so that attributes can be added.
elemName | XML element name. |
pNS | XML namespace information (prefix and URI). If the prefix is NULL, this method will search the context's namespace stack for a prefix to use. |
pNSAttrs | List of namespace attributes to be added to element. |
terminate | Add closing '>' character. |
EXTXMLMETHOD int OSXMLEncodeBase::termStartElement | ( | ) |
This metod terminates a currently open XML start element by adding either a '>' or '/>' (if empty) terminator.
It will also add XSI attributes to the element. Note that is important to use this method to terminate the element rather than writng a closing angle bracket text to the stream directly due to the way state is maintained in the context.