#include <cached_directory.h>
Classes | |
class | Entry |
Public Types | |
enum | FILTER { NONE, DIRECTORY, FILE, MAX } |
typedef std::vector< Entry * > | Entries |
Public Member Functions | |
CachedDirectory () | |
CachedDirectory (const std::string &in_path) | |
CachedDirectory (const std::string &in_path, std::set< std::string > &allowed_exts) | |
CachedDirectory (const std::string &in_path, enum CachedDirectory::FILTER filter, bool use_full_path=false) | |
~CachedDirectory () | |
bool | fail () const |
int | getError () const |
const char * | getPath () const |
const Entries & | getEntries () |
Private Member Functions | |
bool | open (const std::string &in_path) |
bool | open (const std::string &in_path, std::set< std::string > &allowable_exts) |
bool | open (const std::string &in_path, std::set< std::string > &allowed_exts, enum CachedDirectory::FILTER filter) |
Private Attributes | |
std::string | path |
Path to the directory. | |
int | error |
Error code stored from various syscalls. | |
bool | use_full_path |
Entries | entries |
Entries in the directory. | |
Friends | |
std::ostream & | operator<< (std::ostream &output, CachedDirectory &directory) |
A utility class to handle processing the entries/files within a directory.
This class will allow the user to either get a list of the entry names within a given directory.
Definition at line 48 of file cached_directory.h.
Empty Constructor.
Definition at line 47 of file cached_directory.cc.
drizzled::CachedDirectory::CachedDirectory | ( | const std::string & | in_path | ) |
Constructor taking full directory path as sole parameter.
[in] | Path | to the directory to open |
[in] | File | extensions to allow |
drizzled::CachedDirectory::CachedDirectory | ( | const std::string & | in_path, |
std::set< std::string > & | allowed_exts | ||
) |
Constructor taking full directory path as sole parameter.
[in] | Path | to the directory to open |
[in] | File | extensions to allow |
Destructor. Cleans up any resources we've taken
Definition at line 80 of file cached_directory.cc.
References entries.
bool drizzled::CachedDirectory::fail | ( | ) | const [inline] |
Returns whether the CachedDirectory object is in a failed state
Definition at line 98 of file cached_directory.h.
References error.
const Entries& drizzled::CachedDirectory::getEntries | ( | ) | [inline] |
Return the list of entries read from the directory
Definition at line 126 of file cached_directory.h.
References entries.
int drizzled::CachedDirectory::getError | ( | ) | const [inline] |
Returns the stored error code of the last action the directory object took (open, read, etc)
Definition at line 107 of file cached_directory.h.
References error.
const char* drizzled::CachedDirectory::getPath | ( | ) | const [inline] |
Returns the current path for the cached directory
Definition at line 115 of file cached_directory.h.
References path.
bool drizzled::CachedDirectory::open | ( | const std::string & | in_path | ) | [private] |
Encapsulate the logic to open the directory.
[in] | The | path to the directory to open and read |
true | Success |
false | Failure |
bool drizzled::CachedDirectory::open | ( | const std::string & | in_path, |
std::set< std::string > & | allowable_exts | ||
) | [private] |
Encapsulate the logic to open the directory with a set of allowed file extensions to filter for.
[in] | The | path to the directory to open and read |
[in] | File | extensions to allow |
true | Success |
false | Failure |