Class to read the contents of a directory.
#include <UTDirectory.h>
Public Member Functions | |
Directory_t () | |
~Directory_t () | |
Status_t | Open (const Path_t &path) |
Status_t | NextChild (out Path_t *child) |
Status_t | Close () |
Static Public Member Functions | |
static Status_t | GetFileList (const Path_t &path, out gives OwnedList_t< Path_t > *file_list, const utf8 *only_files_starting_with=NULL) |
Definition at line 37 of file UTDirectory.h.
Directory_t::Directory_t | ( | ) | [inline] |
Constructor for an empty directory. Open must be called before it can be used.
Definition at line 92 of file UTDirectory.h.
Directory_t::~Directory_t | ( | ) | [inline] |
Destructor. If the directory is still open, closes it.
Definition at line 99 of file UTDirectory.h.
Opens the specified path for reading the contents.
If a child is available, sets *child to indicate its name and returns true. If no more children are available, returns false. Open must be called before NextChild.
Status_t Directory_t::Close | ( | ) |
Closes the directory.
static Status_t Directory_t::GetFileList | ( | const Path_t & | path, | |
out gives OwnedList_t< Path_t > * | file_list, | |||
const utf8 * | only_files_starting_with = NULL | |||
) | [static] |
Gets a list of files in the directory specified by path. As implied by the use of OwnedList_t for the output list, the caller takes posession of and responsibility for deleting the Path_t objects which will be added to file_list. If only_files_starting_with is not NULL, only files starting with that string will be returned. Depending on the target platform, only_files_starting_with may be case insensitive.