MT Core (C++)
Core library for replacing C++ standard in project usage
|
VTable for synchronous file system. More...
#include <file_sys.hpp>
Public Attributes | |
Result< FILE *, FileError >(* | file_open )(void *state, const char *path, const char *mode) |
Function pointer for opening a file. | |
Result< void, FileError >(* | file_close )(void *state, FILE *fp) |
Function pointer for closing a file. | |
size_t(* | file_read )(void *state, void *buffer, size_t size, size_t count, FILE *stream) |
Function pointer for reading a file. | |
size_t(* | file_write )(void *state, const void *ptr, size_t size, size_t nmemb, FILE *stream) |
Function pointer for writing a file. | |
Result< void, FileError >(* | file_rename )(void *state, const char *oldFileName, const char *newFileName) |
Function pointer for renaming a file. | |
Result< void, FileError >(* | file_remove )(void *state, const char *path) |
Function pointer for removing a file. | |
Result< void, FileError >(* | file_sync )(void *state, FILE *fp) |
Function pointer for syncing a file to disk. | |
size_t(* | file_size )(void *state, FILE *file) |
Function pointer for getting a file's size. | |
bool(* | file_eof )(void *state, FILE *file) |
Checks if file handle is at end of file. | |
FileError(* | file_error )(void *state, FILE *file) |
Checks if a file stream has errors. | |
VTable for synchronous file system.
Designed for providing a simple, minimalistic file system interface to allow easy simulation and replacement
Definition at line 48 of file file_sys.hpp.
Function pointer for closing a file.
fp | File pointer to close |
Definition at line 316 of file file_sys.hpp.
bool(* mtcore::io::SyncFileSystemVTable::file_eof) (void *state, FILE *file) |
Checks if file handle is at end of file.
Definition at line 117 of file file_sys.hpp.
FileError(* mtcore::io::SyncFileSystemVTable::file_error) (void *state, FILE *file) |
Checks if a file stream has errors.
Definition at line 122 of file file_sys.hpp.
Result< FILE *, FileError >(* mtcore::io::SyncFileSystemVTable::file_open) (void *state, const char *path, const char *mode) |
Function pointer for opening a file.
state | State of file system |
path | File path to open |
mode | Opening mode |
Definition at line 316 of file file_sys.hpp.
size_t(* mtcore::io::SyncFileSystemVTable::file_read) (void *state, void *buffer, size_t size, size_t count, FILE *stream) |
Function pointer for reading a file.
buffer | pointer to element buffer to write to |
size | size of each element in the buffer |
count | number of elements in the buffer |
stream | file pointer to read from |
Definition at line 74 of file file_sys.hpp.
Result< void, FileError >(* mtcore::io::SyncFileSystemVTable::file_remove) (void *state, const char *path) |
Function pointer for removing a file.
path | File path to remove |
Definition at line 84 of file file_sys.hpp.
Result< void, FileError >(* mtcore::io::SyncFileSystemVTable::file_rename) (void *state, const char *oldFileName, const char *newFileName) |
Function pointer for renaming a file.
oldFileName | Current file name on disk |
newFileName | File name to rename to |
Definition at line 84 of file file_sys.hpp.
size_t(* mtcore::io::SyncFileSystemVTable::file_size) (void *state, FILE *file) |
Function pointer for getting a file's size.
file | File pointer to get size of |
Definition at line 112 of file file_sys.hpp.
Function pointer for syncing a file to disk.
fp | File pointer to sync to disk |
Definition at line 84 of file file_sys.hpp.
size_t(* mtcore::io::SyncFileSystemVTable::file_write) (void *state, const void *ptr, size_t size, size_t nmemb, FILE *stream) |
Function pointer for writing a file.
ptr | pointer to element buffer to write to file |
size | size of each element in the buffer |
nmemb | number of elements in the buffer |
stream | file pointer to write to from |
Definition at line 84 of file file_sys.hpp.