This file implements a file interface for read only operations. More...
#include "sbgInterface.h"
Go to the source code of this file.
Functions | |
SbgErrorCode | sbgInterfaceFileClose (SbgInterface *pHandle) |
size_t | sbgInterfaceFileGetCursor (const SbgInterface *pHandle) |
size_t | sbgInterfaceFileGetSize (SbgInterface *pHandle) |
SbgErrorCode | sbgInterfaceFileOpen (SbgInterface *pHandle, const char *filePath) |
SbgErrorCode | sbgInterfaceFileRead (SbgInterface *pHandle, void *pBuffer, size_t *pReadBytes, size_t bytesToRead) |
SbgErrorCode | sbgInterfaceFileReadFake (SbgInterface *pHandle, void *pBuffer, size_t *pReadBytes, size_t bytesToRead) |
SbgErrorCode | sbgInterfaceFileWrite (SbgInterface *pHandle, const void *pBuffer, size_t bytesToWrite) |
SbgErrorCode | sbgInterfaceFileWriteFake (SbgInterface *pHandle, const void *pBuffer, size_t bytesToWrite) |
SbgErrorCode | sbgInterfaceFileWriteOpen (SbgInterface *pHandle, const char *filePath) |
This file implements a file interface for read only operations.
Copyright (C) 2007-2013, SBG Systems SAS. All rights reserved.
This source code is intended for use only by SBG Systems SAS and those that have explicit written permission to use it from SBG Systems SAS.
THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
Definition in file sbgInterfaceFile.h.
SbgErrorCode sbgInterfaceFileClose | ( | SbgInterface * | pHandle | ) |
Destroy an interface initialized using sbgInterfaceFileOpen.
[in] | pInterface | Valid handle on an initialized interface. |
Definition at line 113 of file sbgInterfaceFile.c.
size_t sbgInterfaceFileGetCursor | ( | const SbgInterface * | pHandle | ) |
Returns the current cursor position in the file in bytes.
[in] | pInterface | Valid handle on an initialized interface. |
Definition at line 187 of file sbgInterfaceFile.c.
size_t sbgInterfaceFileGetSize | ( | SbgInterface * | pHandle | ) |
Returns the file size in bytes.
[in] | pInterface | Valid handle on an initialized interface. |
Definition at line 144 of file sbgInterfaceFile.c.
SbgErrorCode sbgInterfaceFileOpen | ( | SbgInterface * | pHandle, |
const char * | filePath | ||
) |
Open a file as an interface for read only operations.
[in] | pHandle | Pointer on an allocated interface instance to initialize. |
[in] | filePath | File path to open. |
Definition at line 17 of file sbgInterfaceFile.c.
SbgErrorCode sbgInterfaceFileRead | ( | SbgInterface * | pHandle, |
void * | pBuffer, | ||
size_t * | pReadBytes, | ||
size_t | bytesToRead | ||
) |
Try to read some data from an interface.
[in] | pHandle | Valid handle on an initialized interface. |
[in] | pBuffer | Pointer on an allocated buffer that can hold at least bytesToRead bytes of data. |
[out] | pReadBytes | Pointer on an uint32 used to return the number of read bytes. |
[in] | bytesToRead | Number of bytes we would like to read. |
Definition at line 270 of file sbgInterfaceFile.c.
SbgErrorCode sbgInterfaceFileReadFake | ( | SbgInterface * | pHandle, |
void * | pBuffer, | ||
size_t * | pReadBytes, | ||
size_t | bytesToRead | ||
) |
Fake read function for write only interfaces
[in] | pHandle | Valid handle on an initialized interface. |
[in] | pBuffer | Pointer on an allocated buffer that can hold at least bytesToRead bytes of data. |
[out] | pReadBytes | Pointer on an uint32 used to return the number of read bytes. |
[in] | bytesToRead | Number of bytes we would like to read. |
Definition at line 322 of file sbgInterfaceFile.c.
SbgErrorCode sbgInterfaceFileWrite | ( | SbgInterface * | pHandle, |
const void * | pBuffer, | ||
size_t | bytesToWrite | ||
) |
Try to write some data to an interface.
[in] | pHandle | Valid handle on an initialized interface. |
[in] | pBuffer | Pointer on an allocated buffer that contains the data to write |
[in] | bytesToWrite | Number of bytes we would like to write. |
Definition at line 227 of file sbgInterfaceFile.c.
SbgErrorCode sbgInterfaceFileWriteFake | ( | SbgInterface * | pHandle, |
const void * | pBuffer, | ||
size_t | bytesToWrite | ||
) |
Fake write function for read only interfaces
[in] | pHandle | Valid handle on an initialized interface. |
[in] | pBuffer | Pointer on an allocated buffer that contains the data to write |
[in] | bytesToWrite | Number of bytes we would like to write. |
Definition at line 302 of file sbgInterfaceFile.c.
SbgErrorCode sbgInterfaceFileWriteOpen | ( | SbgInterface * | pHandle, |
const char * | filePath | ||
) |
Open a file as an interface for write only operations.
[in] | pHandle | Pointer on an allocated interface instance to initialize. |
[in] | filePath | File path to open. |
Definition at line 68 of file sbgInterfaceFile.c.