iDRS™ SDK 16
Loading...
Searching...
No Matches
CMemoryStream_interface.h File Reference

Interface for CMemoryStream wrapper. More...

Go to the source code of this file.

Functions

CMemoryStream CMemoryStream_Create (IDRS_UINT const uiInitialMemoryBufferSize, idrs_exception *pargException)
 The Create method creates a memory stream object.
 
CMemoryStream CMemoryStream_Create2 (idrs_exception *pargException)
 The Create method creates a memory stream object.
 
CMemoryStream CMemoryStream_Create3 (CMemoryBuffer argMemoryBuffer, idrs_exception *pargException)
 The Create method creates a memory stream object and initializes the underlying buffer object with the supplied object. If opened for writing, the memory stream object can increase the size of the supplied memory buffer.
 
IDRS_UINT CMemoryStream_Read (CMemoryStream argCMemoryStream, IDRS_PVOID pvMem, IDRS_UINT const uiToRead, idrs_exception *pargException)
 Read reads data from the stream at the current stream position.
 
IDRS_UINT CMemoryStream_Write (CMemoryStream argCMemoryStream, IDRS_CPVOID pvMem, IDRS_UINT const uiToWrite, idrs_exception *pargException)
 Write writes data in the stream at the current position.
 
IDRS_UINT64 CMemoryStream_Seek (CMemoryStream argCMemoryStream, IDRS_INT64 const iOffset, enum SeekPosition const evPos, idrs_exception *pargException)
 Seek changes the current position in the stream.
 
IDRS_BOOL CMemoryStream_IsOpen (const CMemoryStream argCMemoryStream, idrs_exception *pargException)
 IsOpen tests if the stream is opened in read or write mode.
 
IDRS_BOOL CMemoryStream_IsWriteOpen (const CMemoryStream argCMemoryStream, idrs_exception *pargException)
 IsWriteOpen tests if the stream is opened in write mode.
 
IDRS_BOOL CMemoryStream_IsReadOpen (const CMemoryStream argCMemoryStream, idrs_exception *pargException)
 IsReadOpen tests if the stream is opened in read mode.
 
IDRS_UINT CMemoryStream_GetWrittenCount (const CMemoryStream argCMemoryStream, idrs_exception *pargException)
 GetWrittenCount outputs the number of bytes written to the output stream.
 
void CMemoryStream_Destroy (CMemoryStream argCMemoryStream, idrs_exception *pargException)
 Destroys a CMemoryStream handle.
 

Detailed Description

Interface for CMemoryStream wrapper.

Function Documentation

◆ CMemoryStream_Create()

CMemoryStream CMemoryStream_Create ( IDRS_UINT const  uiInitialMemoryBufferSize,
idrs_exception *  pargException 
)

The Create method creates a memory stream object.

Parameters
uiInitialMemoryBufferSizeThe initial memory buffer size.
pargExceptionPointer to exception structure that will be filled if an exception occurs
Returns
The newly created memory stream.
Remarks
Instances created by this method can also be provided to IByteStream methods

◆ CMemoryStream_Create2()

CMemoryStream CMemoryStream_Create2 ( idrs_exception *  pargException)

The Create method creates a memory stream object.

Parameters
pargExceptionPointer to exception structure that will be filled if an exception occurs
Returns
The newly created memory stream.
Remarks
Instances created by this method can also be provided to IByteStream methods

◆ CMemoryStream_Create3()

CMemoryStream CMemoryStream_Create3 ( CMemoryBuffer  argMemoryBuffer,
idrs_exception *  pargException 
)

The Create method creates a memory stream object and initializes the underlying buffer object with the supplied object. If opened for writing, the memory stream object can increase the size of the supplied memory buffer.

Parameters
argMemoryBufferMemory buffer where the memory stream object will read/write the data.
pargExceptionPointer to exception structure that will be filled if an exception occurs
Returns
The newly created memory stream.
Remarks
Instances created by this method can also be provided to IByteStream methods

◆ CMemoryStream_Destroy()

void CMemoryStream_Destroy ( CMemoryStream  argCMemoryStream,
idrs_exception *  pargException 
)

Destroys a CMemoryStream handle.

Parameters
argCMemoryStreamCMemoryStream handle to destroy
pargExceptionPointer to exception structure that will be filled if an exception occurs

◆ CMemoryStream_GetWrittenCount()

IDRS_UINT CMemoryStream_GetWrittenCount ( const CMemoryStream  argCMemoryStream,
idrs_exception *  pargException 
)

GetWrittenCount outputs the number of bytes written to the output stream.

Please note that it only makes sense to call this function when the stream is opened in write mode

Returns
Number of bytes written to the stream
Parameters
argCMemoryStreamCMemoryStream handle
pargExceptionPointer to exception structure that will be filled if an exception occurs

◆ CMemoryStream_IsOpen()

IDRS_BOOL CMemoryStream_IsOpen ( const CMemoryStream  argCMemoryStream,
idrs_exception *  pargException 
)

IsOpen tests if the stream is opened in read or write mode.

Return values
IDRS_TRUEif the stream is opened
IDRS_FALSEotherwise
Parameters
argCMemoryStreamCMemoryStream handle
pargExceptionPointer to exception structure that will be filled if an exception occurs

◆ CMemoryStream_IsReadOpen()

IDRS_BOOL CMemoryStream_IsReadOpen ( const CMemoryStream  argCMemoryStream,
idrs_exception *  pargException 
)

IsReadOpen tests if the stream is opened in read mode.

Return values
IDRS_TRUEif the stream is opened in read mode.
IDRS_FALSEotherwise.
Parameters
argCMemoryStreamCMemoryStream handle
pargExceptionPointer to exception structure that will be filled if an exception occurs

◆ CMemoryStream_IsWriteOpen()

IDRS_BOOL CMemoryStream_IsWriteOpen ( const CMemoryStream  argCMemoryStream,
idrs_exception *  pargException 
)

IsWriteOpen tests if the stream is opened in write mode.

Return values
IDRS_TRUEif the stream is opened in write mode.
IDRS_FALSEotherwise.
Parameters
argCMemoryStreamCMemoryStream handle
pargExceptionPointer to exception structure that will be filled if an exception occurs

◆ CMemoryStream_Read()

IDRS_UINT CMemoryStream_Read ( CMemoryStream  argCMemoryStream,
IDRS_PVOID  pvMem,
IDRS_UINT const  uiToRead,
idrs_exception *  pargException 
)

Read reads data from the stream at the current stream position.

Parameters
argCMemoryStreamCMemoryStream handle
pvMemThe buffer that will receive the data.
uiToReadThe number of bytes to transfer.
pargExceptionPointer to exception structure that will be filled if an exception occurs
Returns
The number of bytes transfered from the stream to pvMem.

◆ CMemoryStream_Seek()

IDRS_UINT64 CMemoryStream_Seek ( CMemoryStream  argCMemoryStream,
IDRS_INT64 const  iOffset,
enum SeekPosition const  evPos,
idrs_exception *  pargException 
)

Seek changes the current position in the stream.

If the current position after cursor update is less than 0, the function will set the current position to 0 If the current position after cursor update is greater than the maximum allocated memory, the class will automatically allocate enough memory so the required cursor position will be valid within the memory buffer

Parameters
argCMemoryStreamCMemoryStream handle
iOffsetThe number of bytes to move the pointer.
evPosPointer movement mode (from begin, current, or end position).
pargExceptionPointer to exception structure that will be filled if an exception occurs
Returns
The new byte offset from the beginning of the stream.

◆ CMemoryStream_Write()

IDRS_UINT CMemoryStream_Write ( CMemoryStream  argCMemoryStream,
IDRS_CPVOID  pvMem,
IDRS_UINT const  uiToWrite,
idrs_exception *  pargException 
)

Write writes data in the stream at the current position.

Parameters
argCMemoryStreamCMemoryStream handle
pvMemThe buffer that contains the data to transfer
uiToWriteThe number of bytes to transfer
pargExceptionPointer to exception structure that will be filled if an exception occurs
Returns
The number of bytes transfered from pvMem to the stream.