F´ Flight Software - C/C++ Documentation NASA-v1.6.0
A framework for building embedded system applications to NASA flight quality standards.
Loading...
Searching...
No Matches
Os::Directory Class Reference

#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)
 

Detailed Description

Definition at line 10 of file Directory.hpp.

Member Enumeration Documentation

◆ Status

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.

Constructor & Destructor Documentation

◆ Directory()

Os::Directory::Directory ( )

Constructor.

Definition at line 16 of file Directory.cpp.

◆ ~Directory()

Os::Directory::~Directory ( )
virtual

Destructor. Will close directory if still open.

Definition at line 19 of file Directory.cpp.

Member Function Documentation

◆ close()

void Os::Directory::close ( )

close directory

Definition at line 119 of file Directory.cpp.

◆ getLastError()

NATIVE_INT_TYPE Os::Directory::getLastError ( )

read back last error code (typically errno)

Definition at line 127 of file Directory.cpp.

◆ getLastErrorString()

const char * Os::Directory::getLastErrorString ( )

get a string of the last error (typically from strerror)

Definition at line 131 of file Directory.cpp.

◆ isOpen()

bool Os::Directory::isOpen ( )

check if file descriptor is open or not.

Definition at line 115 of file Directory.cpp.

◆ open()

Directory::Status Os::Directory::open ( const char *  dirName)

open directory. Directory must already exist

Definition at line 23 of file Directory.cpp.

◆ read() [1/2]

Directory::Status Os::Directory::read ( char *  fileNameBuffer,
U32  bufSize 
)

get next filename from directory

Definition at line 68 of file Directory.cpp.

◆ read() [2/2]

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.

◆ rewind()

Directory::Status Os::Directory::rewind ( )

rewind directory stream to the beginning

Definition at line 52 of file Directory.cpp.


The documentation for this class was generated from the following files: