Interface for CMemoryStream wrapper.
More...
Go to the source code of this file.
|
| 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.
|
| |
Interface for CMemoryStream wrapper.
◆ CMemoryStream_Create()
| CMemoryStream CMemoryStream_Create |
( |
IDRS_UINT const |
uiInitialMemoryBufferSize, |
|
|
idrs_exception * |
pargException |
|
) |
| |
The Create method creates a memory stream object.
- Parameters
-
| uiInitialMemoryBufferSize | The initial memory buffer size. |
| pargException | Pointer to exception structure that will be filled if an exception occurs |
- Returns
- The newly created memory stream.
◆ CMemoryStream_Create2()
| CMemoryStream CMemoryStream_Create2 |
( |
idrs_exception * |
pargException | ) |
|
The Create method creates a memory stream object.
- Parameters
-
| pargException | Pointer to exception structure that will be filled if an exception occurs |
- Returns
- The newly created memory stream.
◆ CMemoryStream_Create3()
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
-
| argMemoryBuffer | Memory buffer where the memory stream object will read/write the data. |
| pargException | Pointer to exception structure that will be filled if an exception occurs |
- Returns
- The newly created memory stream.
◆ CMemoryStream_Destroy()
| void CMemoryStream_Destroy |
( |
CMemoryStream |
argCMemoryStream, |
|
|
idrs_exception * |
pargException |
|
) |
| |
Destroys a CMemoryStream handle.
- Parameters
-
| argCMemoryStream | CMemoryStream handle to destroy |
| pargException | Pointer 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
-
| argCMemoryStream | CMemoryStream handle |
| pargException | Pointer to exception structure that will be filled if an exception occurs |
◆ CMemoryStream_IsOpen()
IsOpen tests if the stream is opened in read or write mode.
- Return values
-
| IDRS_TRUE | if the stream is opened |
| IDRS_FALSE | otherwise |
- Parameters
-
| argCMemoryStream | CMemoryStream handle |
| pargException | Pointer to exception structure that will be filled if an exception occurs |
◆ CMemoryStream_IsReadOpen()
IsReadOpen tests if the stream is opened in read mode.
- Return values
-
| IDRS_TRUE | if the stream is opened in read mode. |
| IDRS_FALSE | otherwise. |
- Parameters
-
| argCMemoryStream | CMemoryStream handle |
| pargException | Pointer to exception structure that will be filled if an exception occurs |
◆ CMemoryStream_IsWriteOpen()
IsWriteOpen tests if the stream is opened in write mode.
- Return values
-
| IDRS_TRUE | if the stream is opened in write mode. |
| IDRS_FALSE | otherwise. |
- Parameters
-
| argCMemoryStream | CMemoryStream handle |
| pargException | Pointer to exception structure that will be filled if an exception occurs |
◆ CMemoryStream_Read()
Read reads data from the stream at the current stream position.
- Parameters
-
| argCMemoryStream | CMemoryStream handle |
| pvMem | The buffer that will receive the data. |
| uiToRead | The number of bytes to transfer. |
| pargException | Pointer to exception structure that will be filled if an exception occurs |
- Returns
- The number of bytes transfered from the stream to pvMem.
◆ CMemoryStream_Seek()
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
-
| argCMemoryStream | CMemoryStream handle |
| iOffset | The number of bytes to move the pointer. |
| evPos | Pointer movement mode (from begin, current, or end position). |
| pargException | Pointer to exception structure that will be filled if an exception occurs |
- Returns
- The new byte offset from the beginning of the stream.
◆ CMemoryStream_Write()
Write writes data in the stream at the current position.
- Parameters
-
| argCMemoryStream | CMemoryStream handle |
| pvMem | The buffer that contains the data to transfer |
| uiToWrite | The number of bytes to transfer |
| pargException | Pointer to exception structure that will be filled if an exception occurs |
- Returns
- The number of bytes transfered from pvMem to the stream.