36 pInputFile = fopen(filePath,
"rb");
46 pHandle->
handle = pInputFile;
82 pInputFile = fopen(filePath,
"wb");
92 pHandle->
handle = pInputFile;
125 pInputFile = (FILE*)(pHandle->
handle);
163 pInputFile = (FILE*)(pHandle->
handle);
173 cursorPos = ftell(pInputFile);
174 fseek(pInputFile, 0, SEEK_END);
175 fileSize = ftell(pInputFile);
176 fseek(pInputFile, cursorPos, SEEK_SET);
179 return (
size_t)fileSize;
199 pInputFile = (FILE*)(pHandle->
handle);
209 return (
size_t)ftell(pInputFile);
241 pOutputFile = (FILE*)(pHandle->
handle);
246 bytesWritten = fwrite(pBuffer,
sizeof(
uint8), bytesToWrite, pOutputFile);
251 if (bytesWritten == bytesToWrite)
284 pInputFile = (FILE*)(pHandle->
handle);
289 *pReadBytes = fread(pBuffer,
sizeof(
uint8), bytesToRead, pInputFile);
size_t sbgInterfaceFileGetCursor(const SbgInterface *pHandle)
SbgErrorCode sbgInterfaceFileRead(SbgInterface *pHandle, void *pBuffer, size_t *pReadBytes, size_t bytesToRead)
SbgErrorCode sbgInterfaceFileClose(SbgInterface *pHandle)
SbgErrorCode sbgInterfaceFileWriteOpen(SbgInterface *pHandle, const char *filePath)
SbgErrorCode sbgInterfaceFileOpen(SbgInterface *pHandle, const char *filePath)
SbgErrorCode sbgInterfaceFileWrite(SbgInterface *pHandle, const void *pBuffer, size_t bytesToWrite)
size_t sbgInterfaceFileGetSize(SbgInterface *pHandle)
SbgErrorCode sbgInterfaceFileWriteFake(SbgInterface *pHandle, const void *pBuffer, size_t bytesToWrite)
SbgInterfaceHandle handle
SbgInterfaceReadFunc pReadFunc
#define SBG_UNUSED_PARAMETER(x)
#define SBG_ASSERT(expression)
SBG_INLINE void sbgInterfaceZeroInit(SbgInterface *pHandle)
SbgErrorCode sbgInterfaceFileReadFake(SbgInterface *pHandle, void *pBuffer, size_t *pReadBytes, size_t bytesToRead)
SbgInterfaceWriteFunc pWriteFunc
enum _SbgErrorCode SbgErrorCode
This file implements a file interface for read only operations.