Flipper Zero Firmware
Loading...
Searching...
No Matches
FS_File_Api Struct Reference

Data Fields

bool(*const open )(void *context, File *file, const char *path, FS_AccessMode access_mode, FS_OpenMode open_mode)
 File api structure.
 
bool(*const close )(void *context, File *file)
 Close file.
 
uint16_t(* read )(void *context, File *file, void *buff, uint16_t bytes_to_read)
 Read bytes from file to buffer.
 
uint16_t(* write )(void *context, File *file, const void *buff, uint16_t bytes_to_write)
 Write bytes from buffer to file.
 
bool(*const seek )(void *context, File *file, uint32_t offset, bool from_start)
 Move r/w pointer.
 
uint64_t(* tell )(void *context, File *file)
 Get r/w pointer position.
 
bool(*const truncate )(void *context, File *file)
 Truncate file size to current r/w pointer position.
 
uint64_t(* size )(void *context, File *file)
 Fet file size.
 
bool(*const sync )(void *context, File *file)
 Write file cache to storage.
 
bool(*const eof )(void *context, File *file)
 Checks that the r/w pointer is at the end of the file.
 

Field Documentation

◆ close

bool(*const FS_File_Api::close) (void *context, File *file)

Close file.

Parameters
filepointer to file object
Returns
success flag

◆ eof

bool(*const FS_File_Api::eof) (void *context, File *file)

Checks that the r/w pointer is at the end of the file.

Parameters
filepointer to file object
Returns
end of file flag

◆ open

bool(*const FS_File_Api::open) (void *context, File *file, const char *path, FS_AccessMode access_mode, FS_OpenMode open_mode)

File api structure.

Open file

Parameters
filepointer to file object, filled by api
pathpath to file
access_modeaccess mode from FS_AccessMode
open_modeopen mode from FS_OpenMode
Returns
success flag

◆ read

uint16_t(* FS_File_Api::read) (void *context, File *file, void *buff, uint16_t bytes_to_read)

Read bytes from file to buffer.

Parameters
filepointer to file object
buffpointer to buffer for reading
bytes_to_readhow many bytes to read, must be smaller or equal to buffer size
Returns
how many bytes actually has been read

◆ seek

bool(*const FS_File_Api::seek) (void *context, File *file, uint32_t offset, bool from_start)

Move r/w pointer.

Parameters
filepointer to file object
offsetoffset to move r/w pointer
from_startset offset from start, or from current position
Returns
success flag

◆ size

uint64_t(* FS_File_Api::size) (void *context, File *file)

Fet file size.

Parameters
filepointer to file object
Returns
file size

◆ sync

bool(*const FS_File_Api::sync) (void *context, File *file)

Write file cache to storage.

Parameters
filepointer to file object
Returns
success flag

◆ tell

uint64_t(* FS_File_Api::tell) (void *context, File *file)

Get r/w pointer position.

Parameters
filepointer to file object
Returns
current r/w pointer position

◆ truncate

bool(*const FS_File_Api::truncate) (void *context, File *file)

Truncate file size to current r/w pointer position.

Parameters
filepointer to file object
Returns
success flag

◆ write

uint16_t(* FS_File_Api::write) (void *context, File *file, const void *buff, uint16_t bytes_to_write)

Write bytes from buffer to file.

Parameters
filepointer to file object
buffpointer to buffer for writing
bytes_to_readhow many bytes to write, must be smaller or equal to buffer size
Returns
how many bytes actually has been written

The documentation for this struct was generated from the following file: