F´ Flight Software - C/C++ Documentation NASA-v1.6.0
A framework for building embedded system applications to NASA flight quality standards.
|
#include <Os/Directory.hpp>
Public Types | |
enum | Status { OP_OK , DOESNT_EXIST , NO_PERMISSION , NOT_OPENED , NOT_DIR , NO_MORE_FILES , OTHER_ERROR } |
Public Member Functions | |
Directory () | |
Constructor. | |
virtual | ~Directory () |
Destructor. Will close directory if still open. | |
Status | open (const char *dirName) |
open directory. Directory must already exist | |
bool | isOpen () |
check if file descriptor is open or not. | |
Status | rewind () |
rewind directory stream to the beginning | |
Status | read (char *fileNameBuffer, U32 bufSize) |
get next filename from directory | |
Status | read (char *fileNameBuffer, U32 bufSize, I64 &inode) |
get next filename and inode from directory | |
void | close () |
close directory | |
NATIVE_INT_TYPE | getLastError () |
read back last error code (typically errno) | |
const char * | getLastErrorString () |
get a string of the last error (typically from strerror) | |
Definition at line 10 of file Directory.hpp.
Enumerator | |
---|---|
OP_OK | Operation was successful. |
DOESNT_EXIST | Directory doesn't exist. |
NO_PERMISSION | No permission to read directory. |
NOT_OPENED | Directory hasn't been opened yet. |
NOT_DIR | Path is not a directory. |
NO_MORE_FILES | Directory stream has no more files. |
OTHER_ERROR | A catch-all for other errors. Have to look in implementation-specific code. |
Definition at line 13 of file Directory.hpp.
Os::Directory::Directory | ( | ) |
Constructor.
Definition at line 16 of file Directory.cpp.
|
virtual |
Destructor. Will close directory if still open.
Definition at line 19 of file Directory.cpp.
void Os::Directory::close | ( | ) |
close directory
Definition at line 119 of file Directory.cpp.
NATIVE_INT_TYPE Os::Directory::getLastError | ( | ) |
read back last error code (typically errno)
Definition at line 127 of file Directory.cpp.
const char * Os::Directory::getLastErrorString | ( | ) |
get a string of the last error (typically from strerror)
Definition at line 131 of file Directory.cpp.
bool Os::Directory::isOpen | ( | ) |
check if file descriptor is open or not.
Definition at line 115 of file Directory.cpp.
Directory::Status Os::Directory::open | ( | const char * | dirName | ) |
open directory. Directory must already exist
Definition at line 23 of file Directory.cpp.
Directory::Status Os::Directory::read | ( | char * | fileNameBuffer, |
U32 | bufSize | ||
) |
get next filename from directory
Definition at line 68 of file Directory.cpp.
Directory::Status Os::Directory::read | ( | char * | fileNameBuffer, |
U32 | bufSize, | ||
I64 & | inode | ||
) |
get next filename and inode from directory
Definition at line 75 of file Directory.cpp.
Directory::Status Os::Directory::rewind | ( | ) |
rewind directory stream to the beginning
Definition at line 52 of file Directory.cpp.