![]() |
F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
|
Posix implementation of Os::Directory. More...
#include <Os/Posix/Directory.hpp>
Public Member Functions | |
PosixDirectory () | |
constructor More... | |
~PosixDirectory ()=default | |
destructor More... | |
DirectoryHandle * | getHandle () override |
return the underlying mutex handle (implementation specific) More... | |
Status | open (const char *path, OpenMode mode) override |
Open or create a directory. More... | |
bool | isOpen () |
Check if Directory is open or not. More... | |
Status | rewind () override |
Rewind directory stream. More... | |
Status | read (char *fileNameBuffer, FwSizeType buffSize) override |
Get next filename from directory stream. More... | |
void | close () override |
Close directory. More... | |
![]() | |
DirectoryInterface ()=default | |
default constructor More... | |
virtual | ~DirectoryInterface ()=default |
default virtual destructor More... | |
DirectoryInterface (const DirectoryInterface &other)=delete | |
copy constructor is forbidden More... | |
DirectoryInterface & | operator= (const DirectoryInterface &other)=delete |
assignment operator is forbidden More... | |
Additional Inherited Members | |
![]() | |
enum | Status { OP_OK, DOESNT_EXIST, NO_PERMISSION, NOT_OPENED, NOT_DIR, NO_MORE_FILES, FILE_LIMIT, BAD_DESCRIPTOR, ALREADY_EXISTS, NOT_SUPPORTED, OTHER_ERROR } |
enum | OpenMode { READ, CREATE_IF_MISSING, CREATE_EXCLUSIVE, MAX_OPEN_MODE } |
![]() | |
static DirectoryInterface * | getDelegate (DirectoryHandleStorage &aligned_new_memory) |
provide a pointer to a Directory delegate object More... | |
Posix implementation of Os::Directory.
Posix implementation of DirectoryInterface
for use as a delegate class handling error-only file operations.
Definition at line 21 of file Directory.hpp.
Os::Posix::Directory::PosixDirectory::PosixDirectory | ( | ) |
constructor
Definition at line 18 of file Directory.cpp.
|
default |
destructor
|
overridevirtual |
|
overridevirtual |
return the underlying mutex handle (implementation specific)
Implements Os::DirectoryInterface.
Definition at line 20 of file Directory.cpp.
bool Os::Posix::Directory::PosixDirectory::isOpen | ( | ) |
|
overridevirtual |
Open or create a directory.
Using the path provided, this function will open or create a directory. Use OpenMode::READ to open an existing directory and error if the directory is not found Use OpenMode::CREATE_IF_MISSING to open a directory, creating the directory if it doesn't exist Use OpenMode::CREATE_EXCLUSIVE to open a directory, creating the directory and erroring if it already exists
It is invalid to pass nullptr
as the path. It is invalid to supply mode
as a non-enumerated value.
path | path of directory to open |
mode | enum (READ, CREATE_IF_MISSING, CREATE_EXCLUSIVE). See notes above for more information |
Implements Os::DirectoryInterface.
Definition at line 24 of file Directory.cpp.
|
overridevirtual |
Get next filename from directory stream.
Writes at most buffSize characters of the file name to fileNameBuffer. This function skips the current directory (.) and parent directory (..) entries. Returns NO_MORE_FILES if there are no more files to read from the buffer.
It is invalid to pass nullptr
as fileNameBuffer.
fileNameBuffer | buffer to store filename |
buffSize | size of fileNameBuffer |
Implements Os::DirectoryInterface.
Definition at line 59 of file Directory.cpp.
|
overridevirtual |
Rewind directory stream.
Each read operation moves the seek position forward. This function resets the seek position to the beginning.
Implements Os::DirectoryInterface.
Definition at line 52 of file Directory.cpp.