OSJSONDecodeBuffer Class Reference
The OSJSONDecodeBuffer class is derived from the OSJSONMessageBuffer base class. More...
#include <OSJSONDecodeBuffer.h>
Public Member Functions | |
OSJSONDecodeBuffer (const char *jsonFile) | |
This version of the OSJSONDecodeBuffer constructor takes a name of a file that contains JSON data to be decoded and constructs a buffer. | |
OSJSONDecodeBuffer (const OSOCTET *msgbuf, size_t bufsiz) | |
This version of the OSJSONDecodeBuffer constructor takes parameters describing a message in memory to be decoded and constructs a buffer. | |
OSJSONDecodeBuffer (OSRTInputStream &inputStream) | |
This version of the OSJSONDecodeBuffer constructor takes a reference to the OSInputStream object. | |
virtual EXTJSONMETHOD int | init () |
This method initializes the decode message 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 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 OSJSONDecodeBuffer class is derived from the OSJSONMessageBuffer base class.
It contains variables and methods specific to decoding JSON messages. It is used to manage an input buffer or stream containing a message to be decoded.
Definition at line 40 of file OSJSONDecodeBuffer.h.
Constructor & Destructor Documentation
OSJSONDecodeBuffer::OSJSONDecodeBuffer | ( | const char * | jsonFile | ) |
This version of the OSJSONDecodeBuffer constructor takes a name of a file that contains JSON data to be decoded and constructs a buffer.
- Parameters:
-
jsonFile A pointer to name of file to be decoded.
OSJSONDecodeBuffer::OSJSONDecodeBuffer | ( | const OSOCTET * | msgbuf, | |
size_t | bufsiz | |||
) |
This version of the OSJSONDecodeBuffer constructor takes parameters describing a message in memory to be decoded and constructs a buffer.
- Parameters:
-
msgbuf A pointer to a buffer containing an JSON message. bufsiz Size of the message buffer.
OSJSONDecodeBuffer::OSJSONDecodeBuffer | ( | OSRTInputStream & | inputStream | ) |
This version of the OSJSONDecodeBuffer constructor takes a reference to the OSInputStream object.
The stream is assumed to have been previuously initialized to point at an encoded JSON message.
- Parameters:
-
inputStream reference to the OSInputStream object
Member Function Documentation
virtual EXTJSONMETHOD int OSJSONDecodeBuffer::init | ( | ) | [virtual] |
This method initializes the decode message buffer.
- Returns:
- Completion status of operation:
- 0 (0) = success,
- negative return value is error.
virtual OSBOOL OSJSONDecodeBuffer::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, JSONEncode, and JSONDecode.
- Returns:
- Boolean result of the match operation. True if the
bufferType
argument isJSONDecode
. argument.
Definition at line 108 of file OSJSONDecodeBuffer.h.
Member Data Documentation
OSBOOL OSJSONDecodeBuffer::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 52 of file OSJSONDecodeBuffer.h.
The documentation for this class was generated from the following file: