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.
 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.
 OSXMLDecodeBuffer (OSRTInputStream &inputStream)
 This version of the OSXMLDecodeBuffer constructor takes a reference to the OSInputStream object.
EXTXMLMETHOD int decodeXML (OSXMLReaderClass *pReader)
 This method decodes an XML message associated with this buffer.
virtual EXTXMLMETHOD int init ()
 This method initializes the decode message buffer.
EXTXMLMETHOD int parseElementName (OSUTF8CHAR **ppName)
 This method parses the initial tag from an XML message.
EXTXMLMETHOD int parseElemQName (OSXMLQName *pQName)
 This method parses the initial tag from an XML message.
EXTXMLMETHOD OSUINT32 setMaxErrors (OSUINT32 maxErrors)
 This method sets the maximum number of errors returned by the SAX parser.
virtual OSBOOL isA (int bufferType)
 This is a virtual method that must be overridden by derived classes to allow identification of the class.

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.

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::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:
xmlFile A pointer to name of file to be decoded.
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:
msgbuf A pointer to a buffer containing an XML message.
bufsiz Size of the message buffer.
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:
inputStream reference to the OSInputStream object

Member Function Documentation

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:
pReader Pointer to OSXMLReaderClass object.
Returns:
Completion status.
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.
virtual OSBOOL OSXMLDecodeBuffer::isA ( int  bufferType  )  [inline, virtual]

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:
bufferType Enumerated 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 161 of file OSXMLDecodeBuffer.h.

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:
ppName Pointer 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.
EXTXMLMETHOD int OSXMLDecodeBuffer::parseElemQName ( OSXMLQName pQName  ) 

This method parses the initial tag from an XML message.

Parameters:
pQName Pointer 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.
EXTXMLMETHOD OSUINT32 OSXMLDecodeBuffer::setMaxErrors ( OSUINT32  maxErrors  ) 

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

Parameters:
maxErrors The desired number of maximum errors.
Returns:
The previously set maximum number of errors.

Field Documentation

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: