![]() |
F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
|
Posix implementation of Os::FileSystem. More...
#include <Os/Posix/FileSystem.hpp>
Public Member Functions | |
PosixFileSystem ()=default | |
constructor More... | |
~PosixFileSystem () override=default | |
destructor More... | |
Status | _removeDirectory (const char *path) override |
Remove a directory at the specified path. More... | |
Status | _removeFile (const char *path) override |
Remove a file at the specified path. More... | |
Status | _rename (const char *sourcePath, const char *destPath) override |
Rename a file from source to destination. More... | |
Status | _getFreeSpace (const char *path, FwSizeType &totalBytes, FwSizeType &freeBytes) override |
Get filesystem free and total space in bytes on the filesystem containing the specified path. More... | |
Status | _getWorkingDirectory (char *path, FwSizeType bufferSize) override |
Get the current working directory. More... | |
Status | _changeWorkingDirectory (const char *path) override |
Change the current working directory to the specified path. More... | |
FileSystemHandle * | getHandle () override |
Get the raw FileSystem handle. More... | |
![]() | |
FileSystemInterface ()=default | |
default constructor More... | |
virtual | ~FileSystemInterface ()=default |
default virtual destructor More... | |
FileSystemInterface (const FileSystemInterface &other)=delete | |
copy constructor is forbidden More... | |
FileSystemInterface & | operator= (const FileSystemInterface &other)=delete |
assignment operator is forbidden More... | |
Additional Inherited Members | |
![]() | |
enum | Status { OP_OK, ALREADY_EXISTS, NO_SPACE, NO_PERMISSION, NOT_DIR, IS_DIR, NOT_EMPTY, INVALID_PATH, DOESNT_EXIST, FILE_LIMIT, BUSY, NO_MORE_FILES, BUFFER_TOO_SMALL, EXDEV_ERROR, OVERFLOW_ERROR, NOT_SUPPORTED, OTHER_ERROR } |
enum | PathType { FILE, DIRECTORY, NOT_EXIST } |
![]() | |
static FileSystemInterface * | getDelegate (FileSystemHandleStorage &aligned_new_memory) |
provide a pointer to a FileSystem delegate object More... | |
![]() | |
static constexpr FwSignedSizeType | FILE_SYSTEM_FILE_CHUNK_SIZE = FW_FILE_CHUNK_SIZE |
Size of file system chunk. More... | |
Posix implementation of Os::FileSystem.
Posix implementation of FileSystemInterface
for use as a delegate class handling error-only fileSystem operations.
Definition at line 20 of file FileSystem.hpp.
|
default |
constructor
|
overridedefault |
destructor
|
overridevirtual |
Change the current working directory to the specified path.
It is invalid to pass nullptr
as the path.
path | The path of the new working directory |
Implements Os::FileSystemInterface.
Definition at line 54 of file FileSystem.cpp.
|
overridevirtual |
Get filesystem free and total space in bytes on the filesystem containing the specified path.
It is invalid to pass nullptr
as the path.
path | The path on the filesystem to query |
totalBytes | Reference to store the total bytes on the filesystem |
freeBytes | Reference to store the free bytes on the filesystem |
Implements Os::FileSystemInterface.
Definition at line 62 of file FileSystem.cpp.
|
overridevirtual |
Get the current working directory.
Writes the current working directory path to the provided buffer of size bufferSize. If the buffer is too small to hold the full path, the function will return BUFFER_TOO_SMALL.
It is invalid to pass nullptr
as the path. It is invalid to pass a bufferSize of 0.
path | Buffer to store the current working directory path |
bufferSize | Size of the buffer |
Implements Os::FileSystemInterface.
Definition at line 46 of file FileSystem.cpp.
|
overridevirtual |
Remove a directory at the specified path.
It is invalid to pass nullptr
as the path.
path | The path of the directory to remove |
Implements Os::FileSystemInterface.
Definition at line 22 of file FileSystem.cpp.
|
overridevirtual |
Remove a file at the specified path.
It is invalid to pass nullptr
as the path.
path | The path of the file to remove |
Implements Os::FileSystemInterface.
Definition at line 30 of file FileSystem.cpp.
|
overridevirtual |
Rename a file from source to destination.
If the rename fails due to a cross-device operation, this function should return EXDEV_ERROR and moveFile can be used instead to force a copy-and-remove.
It is invalid to pass nullptr
as sourcePath or destPath.
sourcePath | The path of the source file |
destPath | The path of the destination file |
Implements Os::FileSystemInterface.
Definition at line 38 of file FileSystem.cpp.
|
overridevirtual |
Get the raw FileSystem handle.
Gets the raw FileSystem handle from the implementation. Note: users must include the implementation specific header to make any real use of this handle. Otherwise it must be passed as an opaque type.
Implements Os::FileSystemInterface.
Definition at line 96 of file FileSystem.cpp.