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

The OSXMLDecodeBuffer class is derived from the OSXMLMessageBuffer base class. More...

#include <OSXMLDecodeBuffer.h>

Inheritance diagram for OSXMLDecodeBuffer:
OSXMLMessageBuffer

Public Member Functions

 OSXMLDecodeBuffer (const char *xmlFile)
 This version of the OSXMLDecodeBuffer constructor takes a name of a file that contains XML data to be decoded and constructs a buffer. More...
 
 OSXMLDecodeBuffer (const OSOCTET *msgbuf, size_t bufsiz)
 This version of the OSXMLDecodeBuffer constructor takes parameters describing a message in memory to be decoded and constructs a buffer. More...
 
 OSXMLDecodeBuffer (OSRTInputStream &inputStream)
 This version of the OSXMLDecodeBuffer constructor takes a reference to the OSInputStream object. More...
 
EXTXMLMETHOD int decodeXML (OSXMLReaderClass *pReader)
 This method decodes an XML message associated with this buffer. More...
 
virtual EXTXMLMETHOD int init ()
 This method initializes the decode message buffer. More...
 
EXTXMLMETHOD OSBOOL isWellFormed ()
 This method determines if an XML fragment is well-formed. More...
 
EXTXMLMETHOD int parseElementName (OSUTF8CHAR **ppName)
 This method parses the initial tag from an XML message. More...
 
EXTXMLMETHOD int parseElemQName (OSXMLQName *pQName)
 This method parses the initial tag from an XML message. More...
 
EXTXMLMETHOD OSUINT32 setMaxErrors (OSUINT32 maxErrors)
 This method sets the maximum number of errors returned by the SAX parser. 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...
 
- 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

OSRTInputStream * mpInputStream
 Input source for message to be decoded.
 
OSBOOL mbOwnStream
 This is set to true if this object creates the underlying stream object. More...
 

Additional Inherited Members

- 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 OSXMLDecodeBuffer class is derived from the OSXMLMessageBuffer base class.

It contains variables and methods specific to decoding XML messages. It is used to manage an input buffer or stream containing a message to be decoded.

Note that the XML decode buffer object does not take a message buffer argument because buffer management is handled by the XML parser.

Definition at line 45 of file OSXMLDecodeBuffer.h.

Constructor & Destructor Documentation

◆ OSXMLDecodeBuffer() [1/3]

OSXMLDecodeBuffer::OSXMLDecodeBuffer ( const char *  xmlFile)

This version of the OSXMLDecodeBuffer constructor takes a name of a file that contains XML data to be decoded and constructs a buffer.

Parameters
xmlFileA pointer to name of file to be decoded.

◆ OSXMLDecodeBuffer() [2/3]

OSXMLDecodeBuffer::OSXMLDecodeBuffer ( const OSOCTET *  msgbuf,
size_t  bufsiz 
)

This version of the OSXMLDecodeBuffer constructor takes parameters describing a message in memory to be decoded and constructs a buffer.

Parameters
msgbufA pointer to a buffer containing an XML message.
bufsizSize of the message buffer.

◆ OSXMLDecodeBuffer() [3/3]

OSXMLDecodeBuffer::OSXMLDecodeBuffer ( OSRTInputStream &  inputStream)

This version of the OSXMLDecodeBuffer constructor takes a reference to the OSInputStream object.

The stream is assumed to have been previuously initialized to point at an encoded XML message.

Parameters
inputStreamreference to the OSInputStream object

Member Function Documentation

◆ decodeXML()

EXTXMLMETHOD int OSXMLDecodeBuffer::decodeXML ( OSXMLReaderClass pReader)

This method decodes an XML message associated with this buffer.

Returns
stat Status of the operation. Possible values are 0 if successful or one of the negative error status codes defined in Appendix A of the C/C++ runtime Common Functions Reference Manual.
Parameters
pReaderPointer to OSXMLReaderClass object.
Returns
Completion status.

◆ init()

virtual EXTXMLMETHOD int OSXMLDecodeBuffer::init ( )
virtual

This method initializes the decode message buffer.

Returns
Completion status of operation:
  • 0 (0) = success,
  • negative return value is error.

◆ isA()

virtual OSBOOL OSXMLDecodeBuffer::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 XMLDecode. argument.

Definition at line 169 of file OSXMLDecodeBuffer.h.

◆ isWellFormed()

EXTXMLMETHOD OSBOOL OSXMLDecodeBuffer::isWellFormed ( )

This method determines if an XML fragment is well-formed.

The stream is reset to the start position following the test.

Returns
Boolean result true if fragment well-formed; false otherwise.

◆ parseElementName()

EXTXMLMETHOD int OSXMLDecodeBuffer::parseElementName ( OSUTF8CHAR **  ppName)

This method parses the initial tag from an XML message.

If the tag is a QName, only the local part of the name is returned.

Parameters
ppNamePointer to a pointer to receive decoded UTF-8 string. Dynamic memory is allocated for the variable using the rtxMemAlloc function.
Returns
Completion status of operation:
  • 0 = success,
  • negative return value is error.

◆ parseElemQName()

EXTXMLMETHOD int OSXMLDecodeBuffer::parseElemQName ( OSXMLQName pQName)

This method parses the initial tag from an XML message.

Parameters
pQNamePointer to a QName structure to receive parsed name prefix and local name. Dynamic memory is allocated for both name parts using the rtxMemAlloc function.
Returns
Completion status of operation:
  • 0 = success,
  • negative return value is error.

◆ setMaxErrors()

EXTXMLMETHOD OSUINT32 OSXMLDecodeBuffer::setMaxErrors ( OSUINT32  maxErrors)

This method sets the maximum number of errors returned by the SAX parser.

Parameters
maxErrorsThe desired number of maximum errors.
Returns
The previously set maximum number of errors.

Member Data Documentation

◆ mbOwnStream

OSBOOL OSXMLDecodeBuffer::mbOwnStream
protected

This is set to true if this object creates the underlying stream object.

In this case, the stream will be deleted in the object's destructor.

Definition at line 57 of file OSXMLDecodeBuffer.h.


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