1 #ifndef DIRECTORY_CLASS
2 #define DIRECTORY_CLASS
46 bool good()
const {
return _scanned_okay; }
Provides a dynamically resizable ASCII character string.
Implements a scanner that finds all filenames in the directory specified.
DEFINE_CLASS_NAME("directory")
bool good() const
true if the directory existed and its contents were readable.
directory(const basis::astring &path, const char *pattern="*")
opens up the "path" specified and scans for files and subdirectories.
bool move_down(const basis::astring &subdir, const char *pattern="*")
changes down into a "subdir" of this directory.
static basis::astring absolute_path(const basis::astring &relative_path)
returns the absolute path to a file with "relative_path".
static bool recursive_create(const basis::astring &directory_name)
returns true if the "directory_name" can be created or already exists.
const structures::string_array & directories() const
these are the directory names from the folder.
static bool remove_directory(const basis::astring &path)
returns true if the directory "path" could be removed.
directory & operator=(const directory &to_copy)
const structures::string_array & files() const
returns the list of files that we found in this directory.
const basis::astring & path() const
returns the directory that we manage.
bool move_up(const char *pattern="*")
resets the directory to be its own parent.
const basis::astring & pattern() const
returns the pattern that the directory class scans for.
static basis::astring current()
returns the current directory, as reported by the operating system.
bool rescan()
reads our current directory's contents over again.
bool reset(const basis::astring &path, const char *pattern="*")
gets rid of any current files and rescans the directory at "path".
static bool make_directory(const basis::astring &path)
returns true if the directory "path" could be created.
An array of strings with some additional helpful methods.
A platform independent way to obtain the timestamp of a file.