6 #ifndef OS_POSIX_FILE_HPP 7 #define OS_POSIX_FILE_HPP 72 void close()
override;
181 #endif // OS_POSIX_FILE_HPP static constexpr PlatformIntType ERROR_RETURN_VALUE
base implementation of FileHandle
Status preallocate(FwSignedSizeType offset, FwSignedSizeType length) override
pre-allocate file storage
Status read(U8 *buffer, FwSignedSizeType &size, WaitType wait) override
read data from this file into supplied buffer bounded by size
PosixFile()=default
constructor
static constexpr PlatformIntType INVALID_FILE_DESCRIPTOR
posix implementation of Os::File
int PlatformIntType
DefaultTypes.hpp provides fallback defaults for the platform types.
~PosixFile() override=default
destructor
Status size(FwSignedSizeType &size_result) override
get size of currently open file
Status position(FwSignedSizeType &position_result) override
get file pointer position of the currently open file
void close() override
close the file, if not opened then do nothing
uint8_t U8
8-bit unsigned integer
PosixFile & operator=(const PosixFile &other)
assignment operator that copies the internal representation
Status seek(FwSignedSizeType offset, SeekType seekType) override
seek the file pointer to the given offset
PlatformSignedSizeType FwSignedSizeType
Status flush() override
flush file contents to storage
FileHandle * getHandle() override
returns the raw file handle
Status write(const U8 *buffer, FwSignedSizeType &size, WaitType wait) override
read data from this file into supplied buffer bounded by size
PlatformIntType m_file_descriptor
Posix file descriptor.
Os::FileInterface::Status open(const char *path, Mode mode, OverwriteType overwrite) override
open file with supplied path and mode