XBinder XML Runtime  XBinder Version 3.0.x
Public Member Functions | Protected Attributes | List of all members
OSXMLEncodeStream Class Reference

The OSXMLEncodeStream class is derived from the OSXMLEncodeBase class. More...

#include <OSXMLEncodeStream.h>

Inheritance diagram for OSXMLEncodeStream:
OSXMLEncodeBase OSXMLMessageBuffer

Public Member Functions

EXTXMLMETHOD OSXMLEncodeStream (OSRTOutputStream &outputStream)
 This version of the OSXMLEncodeStream constructor takes a reference to the OSOutputStream object. More...
 
 OSXMLEncodeStream (OSRTOutputStream *pOutputStream, OSBOOL ownStream=TRUE)
 This version of the OSXMLEncodeStream constructor takes a pointer to the OSRTOutputStream object. More...
 
virtual EXTXMLMETHOD int init ()
 This method reinitializes the encode stream to allow a new message to be encoded. More...
 
virtual OSBOOL isA (Type bufferType)
 This is a virtual method that must be overridden by derived classes to allow identification of the class. More...
 
virtual const OSOCTET * getMsgPtr ()
 This is a virtual method that must be overridden by derived classes to allow access to the stored message. More...
 
OSRTOutputStream * getStream () const
 This method returns the output stream associated with the object. More...
 
- Public Member Functions inherited from OSXMLEncodeBase
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...
 
- Public Member Functions inherited from OSXMLMessageBuffer
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 Attributes

OSRTOutputStream * mpStream
 A pointer to an OSRTOutputStream object. More...
 
OSBOOL mbOwnStream
 TRUE if the OSXMLEncodeStream object will close and free the stream in the destructor. More...
 

Additional Inherited Members

- Protected Member Functions inherited from OSXMLEncodeBase
EXTXMLMETHOD OSXMLEncodeBase (OSRTContext *pContext=0)
 The protected constructor creates a new context and sets the buffer class type. More...
 
- Protected Member Functions inherited from OSXMLMessageBuffer
EXTXMLMETHOD OSXMLMessageBuffer (Type bufferType, OSRTContext *pContext=0)
 The protected constructor creates a new context and sets the buffer class type. More...
 

Detailed Description

The OSXMLEncodeStream class is derived from the OSXMLEncodeBase class.

It contains variables and methods specific to streaming encoding XML messages. It is used to manage the stream into which a message is to be encoded.

Definition at line 40 of file OSXMLEncodeStream.h.

Constructor & Destructor Documentation

◆ OSXMLEncodeStream() [1/2]

EXTXMLMETHOD OSXMLEncodeStream::OSXMLEncodeStream ( OSRTOutputStream &  outputStream)

This version of the OSXMLEncodeStream constructor takes a reference to the OSOutputStream object.

The stream is assumed to have been previously initialized.

Parameters
outputStreamreference to the OSOutputStream object

◆ OSXMLEncodeStream() [2/2]

OSXMLEncodeStream::OSXMLEncodeStream ( OSRTOutputStream *  pOutputStream,
OSBOOL  ownStream = TRUE 
)

This version of the OSXMLEncodeStream constructor takes a pointer to the OSRTOutputStream object.

The stream is assumed to have been previously initialized. If ownStream is set to TRUE, then stream will be closed and freed in the destructor.

Parameters
pOutputStreamreference to the OSOutputStream object
ownStreamset ownership for the passed stream object.

Member Function Documentation

◆ getMsgPtr()

virtual const OSOCTET* OSXMLEncodeStream::getMsgPtr ( )
inlinevirtual

This is a virtual method that must be overridden by derived classes to allow access to the stored message.

The base class implementation returns a null value.

Returns
A pointer to the stored message.

Definition at line 106 of file OSXMLEncodeStream.h.

◆ getStream()

OSRTOutputStream* OSXMLEncodeStream::getStream ( ) const
inline

This method returns the output stream associated with the object.

Returns
A pointer to the output stream.

Definition at line 113 of file OSXMLEncodeStream.h.

◆ init()

virtual EXTXMLMETHOD int OSXMLEncodeStream::init ( )
virtual

This method reinitializes the encode stream to allow a new message to be encoded.

This makes it possible to reuse one stream object in a loop to encode multiple messages.

◆ isA()

virtual OSBOOL OSXMLEncodeStream::isA ( Type  bufferType)
inlinevirtual

This is a virtual method that must be overridden by derived classes to allow identification of the class.

The base class variant is abstract. This method matches an enumerated identifier defined in the base class. One identifier is declared for each of the derived classes.

Parameters
bufferTypeEnumerated identifier specifying a derived class. This type is defined as a public access type in the OSRTMessageBufferIF base interface. Possible values include BEREncode, BERDecode, PEREncode, PERDecode, XMLEncode, and XMLDecode.
Returns
Boolean result of the match operation. True if the bufferType argument is XMLEncode or Stream.

Definition at line 95 of file OSXMLEncodeStream.h.

Member Data Documentation

◆ mbOwnStream

OSBOOL OSXMLEncodeStream::mbOwnStream
protected

TRUE if the OSXMLEncodeStream object will close and free the stream in the destructor.

Definition at line 47 of file OSXMLEncodeStream.h.

◆ mpStream

OSRTOutputStream* OSXMLEncodeStream::mpStream
protected

A pointer to an OSRTOutputStream object.

Definition at line 43 of file OSXMLEncodeStream.h.


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