OSCR
Open Source Cartridge Reader
Loading...
Searching...
No Matches
OSCR::Storage::File Class Reference

Public Member Functions

 File (uint8_t *fileBuffer, uint16_t fileBufferSize)
 File (char const *fileName, oflag_t oflag)
 File (__StringHelper const *fileName, oflag_t oflag)
void assignBuffer (uint8_t *fileBuffer, uint16_t fileBufferSize)
void unassignBuffer ()
bool hasBuffer () const
bool open (char const *fileName, oflag_t oflag)
bool open (__StringHelper const *fileName, oflag_t oflag)
bool open (uint32_t index, oflag_t oflag)
bool isOpen ()
bool close ()
void sync ()
bool rename (char const *newPath)
bool rename (__StringHelper const *newPath)
bool writeRaw (uint8_t byte)
size_t writeRaw (size_t count)
size_t writeRaw (uint8_t const *buf, size_t count)
size_t write ()
size_t write (size_t count)
bool write (uint8_t byte)
size_t write (char const *buf)
size_t write (char const *buf, size_t count)
size_t write (uint8_t const *buf, size_t count)
size_t writeNewLine ()
uint8_t peek ()
size_t readRaw ()
size_t readRaw (size_t count)
size_t readRaw (uint8_t *buf, size_t count)
size_t fill ()
int16_t read ()
size_t read (size_t count)
size_t read (uint8_t *buf, size_t count)
bool find (uint8_t const *target)
bool find (char const *target)
bool find (__StringHelper const *target)
size_t readBytesUntil (char terminator, uint8_t *buf, size_t count)
size_t readBytesUntil (char terminator, char *buf, size_t count)
size_t readBytesUntil (char terminator, size_t count)
size_t readBytesUntil (__StringHelper const *terminator, uint8_t *buf, size_t count)
size_t readBytesUntil (__StringHelper const *terminator, char *buf, size_t count)
size_t readBytesUntil (__StringHelper const *terminator, size_t count)
size_t readBytesUntil_P (uint8_t const *terminator, uint8_t *buf, size_t count)
size_t readBytesUntil_P (uint8_t const *terminator, char *buf, size_t count)
size_t readBytesUntil_P (uint8_t const *terminator, size_t count)
uint32_t fileSize () const
uint64_t fileSize64 () const
uint32_t available () const
uint64_t available64 () const
bool remove ()
uint64_t curPosition () const
bool seekCur (int64_t offset)
bool seekSet (uint64_t pos)
bool seekEnd (int64_t offset=0)
void rewind ()
void crcReset ()
OSCR::CRC32::crc32_t getCRC32 ()
void enableFatalErrors ()
void disableFatalErrors ()
bool getName (char *name, size_t len)

Protected Member Functions

void bufferCheck (size_t count)
void postOpen ()
void postClose ()
void sumCRC32 ()

Protected Attributes

FsFile file
oflag_t fileOflag
bool fatalErrors = true
bool opened = false
CRC32State crcState = CRC32State::None
OSCR::CRC32::crc32_t fCRC32 = OSCR::CRC32::crc32_t()
uint8_t * buffer = nullptr
uint16_t bufferSize = 0

The documentation for this class was generated from the following file:
  • C:/Developer/Projects/OSCR/oscr-firmware/include/api/Storage.h