Struct SolidSyslogFile¶
#include <SolidSyslogFileDefinition.h>
struct SolidSyslogFile
{
bool (*Open)(struct SolidSyslogFile* base, const char* path);
void (*Close)(struct SolidSyslogFile* base);
bool (*IsOpen)(struct SolidSyslogFile* base);
bool (*Read)(struct SolidSyslogFile* base, void* buf, size_t count);
bool (*Write)(struct SolidSyslogFile* base, const void* buf, size_t count);
void (*SeekTo)(struct SolidSyslogFile* base, size_t offset);
size_t (*Size)(struct SolidSyslogFile* base);
void (*Truncate)(struct SolidSyslogFile* base);
bool (*Exists)(struct SolidSyslogFile* base, const char* path);
bool (*Delete)(struct SolidSyslogFile* base, const char* path);
};
Detailed Description¶
The File contract a porter implements (FatFs, FreeRTOS-Plus-FAT, a raw flash driver...).
One instance holds at most one open file; Open on an already-open instance is not expected. Read/Write share a single position moved by SeekTo, so the consumer seeks before each transfer.
Public Attributes Documentation¶
Close¶
No-op if already closed.
Delete¶
Remove path ; true also when it was already absent.
Independent of any open file.
Exists¶
Queries path on the filesystem, independent of any open file.
IsOpen¶
Open¶
Open path for reading and writing, creating it empty if absent and preserving existing content otherwise (never truncates on open).
Return value:
falseopen failed; the instance stays closed.
Read¶
Read exactly count bytes at the current position intobuf .
Return value:
falsefewer thancountbytes were available (short read or error);bufcontent is then unspecified. Partial success is not distinguished from failure.
SeekTo¶
Position for the next Read/Write, absolute from the start.
Errors are silent.
Size¶
Current length in bytes; 0 on error.
Truncate¶
Discard all content, leaving the file open at length 0.
Write¶
Write exactly count bytes at the current position and commit them to the media before returning (the BlockStore treats a true return as durable across power loss, so an implementation must flush).
Return value:
falsethe fullcountwas not written and committed.
The documentation for this class was generated from the following file Core/Interface/SolidSyslogFileDefinition.h