ASN1C C/C++ Common Runtime  ASN1C v7.6.x
Public Member Functions | List of all members
OSRTMemoryOutputStream Class Reference

#include <OSRTMemoryOutputStream.h>

Inheritance diagram for OSRTMemoryOutputStream:
OSRTOutputStream OSRTStream

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 OSCTXTgetCtxtPtr ()
 
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
 

Detailed Description

Generic memory output stream. This class provides methods for streaming data to an output memory buffer.

Constructor & Destructor Documentation

◆ OSRTMemoryOutputStream() [1/3]

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.

See also
rtxStreamMemoryCreate

◆ OSRTMemoryOutputStream() [2/3]

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.

Parameters
pMemBufThe pointer to the buffer.
bufSizeThe size of the buffer.
See also
rtxStreamMemoryAttach

◆ OSRTMemoryOutputStream() [3/3]

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.

Parameters
pContextPointer to a context to use.
pMemBufThe pointer to the buffer.
bufSizeThe size of the buffer.
See also
rtxStreamMemoryAttach

Member Function Documentation

◆ getBuffer()

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.

Parameters
pSizePointer 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.
Returns
Pointer to memory buffer.

◆ isA()

virtual OSBOOL OSRTMemoryOutputStream::isA ( StreamID  id) const
inlinevirtual

This method is used to query a stream object in order to determine its actual type.

Parameters
idEnumerated stream identifier
Returns
True if the stream matches the identifier

Reimplemented from OSRTOutputStream.

◆ reset()

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.

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

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