ASN1C C/C++ Common Runtime
ASN1C v7.6.x
|
#include <OSRTMemoryOutputStream.h>
Public Member Functions | |
EXTRTMETHOD | OSRTMemoryOutputStream () |
EXTRTMETHOD | OSRTMemoryOutputStream (OSOCTET *pMemBuf, size_t bufSize) |
EXTRTMETHOD | OSRTMemoryOutputStream (OSRTContext *pContext, OSOCTET *pMemBuf, size_t bufSize) |
EXTRTMETHOD OSOCTET * | getBuffer (size_t *pSize=0) |
virtual OSBOOL | isA (StreamID id) const |
int | reset () |
Public Member Functions inherited from OSRTOutputStream | |
EXTRTMETHOD | OSRTOutputStream () |
EXTRTMETHOD | OSRTOutputStream (OSRTContext *mpContext, OSBOOL attachStream=FALSE) |
virtual EXTRTMETHOD | ~OSRTOutputStream () |
virtual EXTRTMETHOD int | close () |
virtual EXTRTMETHOD int | flush () |
virtual OSRTCtxtPtr | getContext () |
virtual OSCTXT * | getCtxtPtr () |
virtual char * | getErrorInfo () |
virtual char * | getErrorInfo (char *pBuf, size_t &bufSize) |
virtual int | getStatus () const |
virtual EXTRTMETHOD OSBOOL | isOpened () |
void | printErrorInfo () |
void | resetErrorInfo () |
virtual EXTRTMETHOD long | write (const OSOCTET *pdata, size_t size) |
virtual EXTRTMETHOD long | write (const char *pdata) |
Public Member Functions inherited from OSRTStream | |
virtual EXTRTMETHOD | ~OSRTStream () |
int | getStatus () const |
OSBOOL | isInitialized () |
void | printErrorInfo () |
void | resetErrorInfo () |
Additional Inherited Members | |
Protected Member Functions inherited from OSRTStream | |
EXTRTMETHOD | OSRTStream (OSRTContext *pContext, OSBOOL attachStream=FALSE) |
EXTRTMETHOD | OSRTStream (OSRTStream &original) |
EXTRTMETHOD | OSRTStream () |
EXTRTMETHOD char * | getErrorInfo (size_t *pBufSize) |
Protected Attributes inherited from OSRTStream | |
OSRTCtxtHolder | mCtxtHolder |
OSBOOL | mbAttached |
int | mStatus |
int | mInitStatus |
Generic memory output stream. This class provides methods for streaming data to an output memory buffer.
EXTRTMETHOD OSRTMemoryOutputStream::OSRTMemoryOutputStream | ( | ) |
The default constructor initializes the memory output stream to use a dynamic memory output buffer. The status of the construction can be obtained by calling the getStatus
method.
EXTRTMETHOD OSRTMemoryOutputStream::OSRTMemoryOutputStream | ( | OSOCTET * | pMemBuf, |
size_t | bufSize | ||
) |
Initializes the memory output stream using the specified memory buffer. The status of the construction can be obtained by calling the getStatus
method.
pMemBuf | The pointer to the buffer. |
bufSize | The size of the buffer. |
EXTRTMETHOD OSRTMemoryOutputStream::OSRTMemoryOutputStream | ( | OSRTContext * | pContext, |
OSOCTET * | pMemBuf, | ||
size_t | bufSize | ||
) |
Initializes the memory output stream using the specified memory buffer. The status of the construction can be obtained by calling the getStatus
method.
pContext | Pointer to a context to use. |
pMemBuf | The pointer to the buffer. |
bufSize | The size of the buffer. |
EXTRTMETHOD OSOCTET* OSRTMemoryOutputStream::getBuffer | ( | size_t * | pSize = 0 | ) |
This method returns the address of the memory buffer to which data was written. If the buffer memory is dynamic, it may be freed using the rtxMemFreePtr function or it will be freed when the stream object is destroyed.
pSize | Pointer to a size variable to receive the number of bytes written to the stream. This is an optional parameter, if a null pointer is passed, size is not returned. |
|
inlinevirtual |
This method is used to query a stream object in order to determine its actual type.
id | Enumerated stream identifier |
Reimplemented from OSRTOutputStream.
int OSRTMemoryOutputStream::reset | ( | ) |
This method resets the output memory stream internal buffer to allow it to be overwritten with new data. Memory for the buffer is not freed.