5 #ifndef OS_INTERFACES_FILEINTERFACE_HPP_ 6 #define OS_INTERFACES_FILEINTERFACE_HPP_ 40 virtual void close() = 0;
144 #endif // OS_INTERFACES_FILEINTERFACE_HPP_ virtual Status open(const char *path, Mode mode, OverwriteType overwrite)=0
open file with supplied path and mode
base implementation of FileHandle
PlatformSizeType FwSizeType
virtual void close()=0
close the file, if not opened then do nothing
PlatformSignedSizeType FwSignedSizeType
virtual FileHandle * getHandle()=0
returns the raw file handle
virtual ~FileInterface()=default
virtual Status size(FwSizeType &size_result)=0
get size of currently open file
virtual Status flush()=0
flush file contents to storage
virtual Status seek(FwSignedSizeType offset, SeekType seekType)=0
seek the file pointer to the given offset
types and constants shared by users of Os::File and by its implementations
uint8_t U8
8-bit unsigned integer
virtual Status write(const U8 *buffer, FwSizeType &size, WaitType wait)=0
read data from this file into supplied buffer bounded by size
virtual Status preallocate(FwSizeType offset, FwSizeType length)=0
pre-allocate file storage
virtual Status position(FwSizeType &position_result)=0
get file pointer position of the currently open file
virtual Status read(U8 *buffer, FwSizeType &size, WaitType wait)=0
read data from this file into supplied buffer bounded by size