#include <OTC/files/directry.hh> class OTC_Directory {
public:
static os_typespec* get_os_typespec();
OTC_Directory(OTC_String const& theName);
OTC_Directory(OTC_Directory const& theDir);
inline OTC_Directory& operator=(OTC_String const& theName);
inline OTC_Directory& operator=(OTC_Directory const& theDir);
inline OTC_String const& name() const;
OTC_Boolean isSearchable() const;
OTC_Iterator<OTC_String> files() const;
OTC_Iterator<OTC_String> files(char const* thePattern) const;
};
OTC_Directory
class is a wrapper around the opendir(3)
,
readdir(3)
system calls.
OTC_Directory(OTC_String const& theName);
theName
. Note that theName
is used as is, ie. leading and trailing
whitespace is not removed. If this is
required it should be done before hand.
OTC_Directory(OTC_Directory const& theDir);
theDir
.
inline OTC_Directory& operator=(OTC_String const& theName);
theName
.
inline OTC_Directory& operator=(OTC_Directory const& theDir);
theDir
.
inline OTC_String const& name() const;
OTC_Boolean isSearchable() const;
OTCLIB_TRUE
if the file named by
the string to the constructor is actually
a directory and that the directory exists
and is searchable. This is determined by
trying to open it as a directory.
OTC_Iterator<OTC_String> files() const;
OTC_Iterator<OTC_String> files(char const* thePattern) const;
thePattern
. Any
changes made to the directory while this
iterator is active will not be reflected
in the iterator. If the directory is not
searchable then a null iterator is
returned.