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

Interface for IByteStream wrapper. More...

Go to the source code of this file.

Functions

IByteStream IByteStream_Create (PtrReadFn ptrReadFn, PtrWriteFn ptrWriteFn, PtrSeekFn ptrSeekFn, PtrIsOpenFn ptrIsOpenFn, PtrIsWriteOpenFn ptrIsWriteOpenFn, PtrIsReadOpenFn ptrIsReadOpenFn, idrs_exception *pargException)
 Creates a new IByteStream object.
 
void IByteStream_Destroy (IByteStream argIByteStream, idrs_exception *pargException)
 Destroys a IByteStream handle.
 
IDRS_UINT IByteStream_Read (IByteStream argIByteStream, IDRS_PVOID pvMem, IDRS_UINT const uiToRead, idrs_exception *pargException)
 Read reads data from the stream at the current stream position.
 
IDRS_UINT IByteStream_Write (IByteStream argIByteStream, IDRS_CPVOID pvMem, IDRS_UINT const uiToWrite, idrs_exception *pargException)
 Write writes data in the stream at the current position.
 
IDRS_UINT64 IByteStream_Seek (IByteStream argIByteStream, IDRS_INT64 const iOffset, enum SeekPosition const evPos, idrs_exception *pargException)
 Seek changes the current position in the stream.
 
IDRS_BOOL IByteStream_IsOpen (const IByteStream argIByteStream, idrs_exception *pargException)
 IsOpen tests if the stream is opened in read or write mode.
 
IDRS_BOOL IByteStream_IsWriteOpen (const IByteStream argIByteStream, idrs_exception *pargException)
 IsWriteOpen tests if the stream is opened in write mode.
 
IDRS_BOOL IByteStream_IsReadOpen (const IByteStream argIByteStream, idrs_exception *pargException)
 IsReadOpen tests if the stream is opened in read mode.
 

Detailed Description

Interface for IByteStream wrapper.

Function Documentation

◆ IByteStream_Create()

IByteStream IByteStream_Create ( PtrReadFn  ptrReadFn,
PtrWriteFn  ptrWriteFn,
PtrSeekFn  ptrSeekFn,
PtrIsOpenFn  ptrIsOpenFn,
PtrIsWriteOpenFn  ptrIsWriteOpenFn,
PtrIsReadOpenFn  ptrIsReadOpenFn,
idrs_exception *  pargException 
)

Creates a new IByteStream object.

Parameters
ptrReadFnRead function pointer
ptrWriteFnWrite function pointer
ptrSeekFnSeek function pointer
ptrIsOpenFnIsOpen function pointer
ptrIsWriteOpenFnIsWriteOpen function pointer
ptrIsReadOpenFnIsReadOpen function pointer
pargExceptionPointer to exception structure that will be filled if an exception occurs
Returns
The newly created IByteStream

◆ IByteStream_Destroy()

void IByteStream_Destroy ( IByteStream  argIByteStream,
idrs_exception *  pargException 
)

Destroys a IByteStream handle.

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

◆ IByteStream_IsOpen()

IDRS_BOOL IByteStream_IsOpen ( const IByteStream  argIByteStream,
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
argIByteStreamIByteStream handle
pargExceptionPointer to exception structure that will be filled if an exception occurs

◆ IByteStream_IsReadOpen()

IDRS_BOOL IByteStream_IsReadOpen ( const IByteStream  argIByteStream,
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
argIByteStreamIByteStream handle
pargExceptionPointer to exception structure that will be filled if an exception occurs

◆ IByteStream_IsWriteOpen()

IDRS_BOOL IByteStream_IsWriteOpen ( const IByteStream  argIByteStream,
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
argIByteStreamIByteStream handle
pargExceptionPointer to exception structure that will be filled if an exception occurs

◆ IByteStream_Read()

IDRS_UINT IByteStream_Read ( IByteStream  argIByteStream,
IDRS_PVOID  pvMem,
IDRS_UINT const  uiToRead,
idrs_exception *  pargException 
)

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

Parameters
argIByteStreamIByteStream 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.

◆ IByteStream_Seek()

IDRS_UINT64 IByteStream_Seek ( IByteStream  argIByteStream,
IDRS_INT64 const  iOffset,
enum SeekPosition const  evPos,
idrs_exception *  pargException 
)

Seek changes the current position in the stream.

Parameters
argIByteStreamIByteStream 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.

◆ IByteStream_Write()

IDRS_UINT IByteStream_Write ( IByteStream  argIByteStream,
IDRS_CPVOID  pvMem,
IDRS_UINT const  uiToWrite,
idrs_exception *  pargException 
)

Write writes data in the stream at the current position.

Parameters
argIByteStreamIByteStream 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.