Home > Support > Documentation

OSXMLDecodeBuffer Class Reference

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

#include <rtXmlCppMsgBuf.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.
int decodeXML (OSXMLReaderClass *pReader)
 This method decodes an XML message associated with this buffer.
virtual int init ()
 This method initializes the decode message buffer.
int parseElementName (OSUTF8CHAR **ppName)
 This method parses the initial tag from an XML message.
int parseElemQName (OSXMLQName *pQName)
 This method parses the initial tag from an XML message.
OSUINT32 setMaxErrors (OSUINT32 maxErrors)
 This method sets the maximum number of errors returned by the SAX parser.
const char * getXmlFileName ()
 This method returns the name of the XML file that is associated with the current buffer.
virtual OSBOOL isA (int bufferType)
 This is a virtual method that must be overridden by derived classes to allow identification of the class.

Protected Types

enum  { INPUT_FILE, INPUT_STREAM, INPUT_STREAM_ATTACHED, INPUT_MEMORY }
 This enumeration associates each possible input location with an ID to properly decode the input data.

Protected Member Functions

void initContextData ()

Protected Attributes

union {
   const char *   fileName
   OSRTInputStream *   pInputStream
   struct {
      const OSOCTET *   pMemBuf
      size_t   bufSize
   }   memBuf
mInput
 This structure stores the location of the input buffer.
enum OSXMLDecodeBuffer:: { ... }  mInputId
 This enumeration associates each possible input location with an ID to properly decode the input data.

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 the input buffer 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 298 of file rtXmlCppMsgBuf.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

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.

const char* OSXMLDecodeBuffer::getXmlFileName  )  [inline]
 

This method returns the name of the XML file that is associated with the current buffer.

Returns:
Name of the XML file that is associated with this object.

Definition at line 415 of file rtXmlCppMsgBuf.h.

virtual 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 435 of file rtXmlCppMsgBuf.h.

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.

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.

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

union { ... } OSXMLDecodeBuffer::mInput [protected]
 

This structure stores the location of the input buffer.

Possible inputs are a file on disk, an input stream, or a memory buffer.


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