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

Interface for CFileStream wrapper. More...

Go to the source code of this file.

Functions

CFileStream CFileStream_Create (const idrs_string strFileName, enum FileStreamMode const evFileStreamMode, idrs_exception *pargException)
 Create creates a CFileStream object and opens the stream.
 
CFileStream CFileStream_Create2 (const idrs_string strFileName, idrs_exception *pargException)
 Create creates a CFileStream object and opens the stream.
 
void CFileStream_Open (CFileStream argCFileStream, const idrs_string strFileName, enum FileStreamMode const evFileStreamMode, idrs_exception *pargException)
 Open opens a stream.
 
void CFileStream_Open2 (CFileStream argCFileStream, const idrs_string strFileName, idrs_exception *pargException)
 Open opens a stream.
 
enum FileStreamMode CFileStream_GetFileStreamMode (const CFileStream argCFileStream, idrs_exception *pargException)
 GetFileStreamMode returns the open file mode.
 
IDRS_UINT CFileStream_Read (CFileStream argCFileStream, IDRS_PVOID pvMem, IDRS_UINT const uiToRead, idrs_exception *pargException)
 Read reads data from the stream at the current stream position.
 
IDRS_UINT CFileStream_Write (CFileStream argCFileStream, IDRS_CPVOID pvMem, IDRS_UINT const uiToWrite, idrs_exception *pargException)
 Write writes data in the stream at the current position.
 
void CFileStream_Close (CFileStream argCFileStream, idrs_exception *pargException)
 Closes the current opened file.
 
IDRS_UINT64 CFileStream_Seek (CFileStream argCFileStream, IDRS_INT64 const iOffset, enum SeekPosition const evPos, idrs_exception *pargException)
 Seek changes the current position in the file stream.
 
IDRS_BOOL CFileStream_IsOpen (const CFileStream argCFileStream, idrs_exception *pargException)
 IsOpen tests if the file stream is opened in read or write mode.
 
IDRS_BOOL CFileStream_IsWriteOpen (const CFileStream argCFileStream, idrs_exception *pargException)
 IsWriteOpen tests if the file stream is opened in write mode.
 
IDRS_BOOL CFileStream_IsReadOpen (const CFileStream argCFileStream, idrs_exception *pargException)
 IsReadOpen tests if the file stream is opened in read mode.
 
void CFileStream_Delete (const idrs_string strFileName, idrs_exception *pargException)
 Deletes the file specified.
 
void CFileStream_Destroy (CFileStream argCFileStream, idrs_exception *pargException)
 Destroys a CFileStream handle.
 

Detailed Description

Interface for CFileStream wrapper.

Function Documentation

◆ CFileStream_Close()

void CFileStream_Close ( CFileStream  argCFileStream,
idrs_exception *  pargException 
)

Closes the current opened file.

Closes the file currently associated with the object, disassociating it from the stream. Any pending output sequence is written to the physical file.

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

◆ CFileStream_Create()

CFileStream CFileStream_Create ( const idrs_string  strFileName,
enum FileStreamMode const  evFileStreamMode,
idrs_exception *  pargException 
)

Create creates a CFileStream object and opens the stream.

Parameters
strFileNameThe name of the file to open.
evFileStreamModeThe mode to open the file, by default Read.
pargExceptionPointer to exception structure that will be filled if an exception occurs
Remarks
Instances created by this method can also be provided to IByteStream methods

◆ CFileStream_Create2()

CFileStream CFileStream_Create2 ( const idrs_string  strFileName,
idrs_exception *  pargException 
)

Create creates a CFileStream object and opens the stream.

Parameters
strFileNameThe name of the file to open.
pargExceptionPointer to exception structure that will be filled if an exception occurs
Remarks
Instances created by this method can also be provided to IByteStream methods

◆ CFileStream_Delete()

void CFileStream_Delete ( const idrs_string  strFileName,
idrs_exception *  pargException 
)

Deletes the file specified.

Parameters
strFileNameThe name of the file to delete.
pargExceptionPointer to exception structure that will be filled if an exception occurs

◆ CFileStream_Destroy()

void CFileStream_Destroy ( CFileStream  argCFileStream,
idrs_exception *  pargException 
)

Destroys a CFileStream handle.

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

◆ CFileStream_GetFileStreamMode()

enum FileStreamMode CFileStream_GetFileStreamMode ( const CFileStream  argCFileStream,
idrs_exception *  pargException 
)

GetFileStreamMode returns the open file mode.

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

◆ CFileStream_IsOpen()

IDRS_BOOL CFileStream_IsOpen ( const CFileStream  argCFileStream,
idrs_exception *  pargException 
)

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

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

◆ CFileStream_IsReadOpen()

IDRS_BOOL CFileStream_IsReadOpen ( const CFileStream  argCFileStream,
idrs_exception *  pargException 
)

IsReadOpen tests if the file stream is opened in read mode.

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

◆ CFileStream_IsWriteOpen()

IDRS_BOOL CFileStream_IsWriteOpen ( const CFileStream  argCFileStream,
idrs_exception *  pargException 
)

IsWriteOpen tests if the file stream is opened in write mode.

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

◆ CFileStream_Open()

void CFileStream_Open ( CFileStream  argCFileStream,
const idrs_string  strFileName,
enum FileStreamMode const  evFileStreamMode,
idrs_exception *  pargException 
)

Open opens a stream.

Closes the currently opened stream if necessary.

Parameters
argCFileStreamCFileStream handle
strFileNameThe name of the file to open.
evFileStreamModeThe mode to open the file, by default Read.
pargExceptionPointer to exception structure that will be filled if an exception occurs

◆ CFileStream_Open2()

void CFileStream_Open2 ( CFileStream  argCFileStream,
const idrs_string  strFileName,
idrs_exception *  pargException 
)

Open opens a stream.

Closes the currently opened stream if necessary.

Parameters
argCFileStreamCFileStream handle
strFileNameThe name of the file to open.
pargExceptionPointer to exception structure that will be filled if an exception occurs

◆ CFileStream_Read()

IDRS_UINT CFileStream_Read ( CFileStream  argCFileStream,
IDRS_PVOID  pvMem,
IDRS_UINT const  uiToRead,
idrs_exception *  pargException 
)

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

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

◆ CFileStream_Seek()

IDRS_UINT64 CFileStream_Seek ( CFileStream  argCFileStream,
IDRS_INT64 const  iOffset,
enum SeekPosition const  evPos,
idrs_exception *  pargException 
)

Seek changes the current position in the file stream.

Parameters
argCFileStreamCFileStream 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 file stream.

◆ CFileStream_Write()

IDRS_UINT CFileStream_Write ( CFileStream  argCFileStream,
IDRS_CPVOID  pvMem,
IDRS_UINT const  uiToWrite,
idrs_exception *  pargException 
)

Write writes data in the stream at the current position.

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