Inherited by YGP::DirectorySearch, and YGP::RemoteDirSearch.
Public Member Functions | |
IDirectorySearch () | |
virtual | ~IDirectorySearch () |
virtual void | setSearchValue (const std::string &search)=0 |
std::string | getSearchValue () const |
virtual std::string | getDirectory () const =0 |
virtual std::string | getFileSpec () const =0 |
virtual bool | isValid () const =0 |
Searching | |
virtual const File * | find (unsigned long attribs=FILE_NORMAL)=0 |
virtual const File * | next ()=0 |
Static Public Member Functions | |
static bool | isSpecial (const char *pFile) |
static unsigned long | convertToSysAttribs (unsigned long attributes) |
static unsigned long | convertFromSysAttribs (unsigned long attributes) |
Static Public Attributes | |
static const int | FILE_NORMAL = 1 |
static const int | FILE_READONLY = 2 |
static const int | FILE_DIRECTORY = 4 |
static const int | FILE_HIDDEN = 8 |
Protected Member Functions | |
void | clearEntry () |
Protected Attributes | |
File * | pEntry |
The following attributes are supported for files:
YGP::IDirectorySearch::IDirectorySearch | ( | ) | [inline] |
Default constructor.
YGP::IDirectorySearch::~IDirectorySearch | ( | ) | [virtual] |
Destructor.
void YGP::IDirectorySearch::clearEntry | ( | ) | [inline, protected] |
Frees the buffer holding the last found file.
unsigned long YGP::IDirectorySearch::convertFromSysAttribs | ( | unsigned long | attribs | ) | [static] |
Converts the attributes as used by the system into attributes used by IDirectorySearch (as defined at the top).
attribs | Attributes to convert |
unsigned long YGP::IDirectorySearch::convertToSysAttribs | ( | unsigned long | attribs | ) | [static] |
Converts attributes according to IDirectorySearch (as defined at the top) into values used by the system.
attribs | Attributes to convert |
virtual const File* YGP::IDirectorySearch::find | ( | unsigned long | attribs = FILE_NORMAL |
) | [pure virtual] |
Method to start a find the files previously specified.
Additonally the files returned must match the passed attributes.
To be implemented by derived classes.
Implemented in YGP::DirectorySearch, YGP::PathDirectorySearch, and YGP::RemoteDirSearch.
virtual std::string YGP::IDirectorySearch::getDirectory | ( | ) | const [pure virtual] |
Intended to return the directory part of the files to search for; to be implemented by derived classes.
Implemented in YGP::DirectorySearch, and YGP::RemoteDirSearch.
virtual std::string YGP::IDirectorySearch::getFileSpec | ( | ) | const [pure virtual] |
Intended to return the name/file part of the files to search for; to be implemented by derived classes.
Implemented in YGP::DirectorySearch, and YGP::RemoteDirSearch.
std::string YGP::IDirectorySearch::getSearchValue | ( | ) | const [inline] |
Returns the files to search for.
static bool YGP::IDirectorySearch::isSpecial | ( | const char * | pFile | ) | [inline, static] |
Checks if the passed file is a "special" file (the system directories `.
' and `..').
virtual bool YGP::IDirectorySearch::isValid | ( | ) | const [pure virtual] |
Intended to check if the previously set search values are valid (e.g.
the directory is valid, ...)
To be implemented by derived classes.
True
if values are OK, false otherwise Implemented in YGP::DirectorySearch, and YGP::RemoteDirSearch.
virtual const File* YGP::IDirectorySearch::next | ( | ) | [pure virtual] |
Method to find the next file matching the previously specified values.
To be implemented by derived classes.
Implemented in YGP::DirectorySearch, YGP::PathDirectorySearch, and YGP::RemoteDirSearch.
virtual void YGP::IDirectorySearch::setSearchValue | ( | const std::string & | search | ) | [pure virtual] |
Intended to set the files to search for; to be implemented by derived classes.
Implemented in YGP::DirectorySearch, and YGP::RemoteDirSearch.
const int YGP::IDirectorySearch::FILE_DIRECTORY = 4 [static] |
const int YGP::IDirectorySearch::FILE_HIDDEN = 8 [static] |
const int YGP::IDirectorySearch::FILE_NORMAL = 1 [static] |
const int YGP::IDirectorySearch::FILE_READONLY = 2 [static] |
File* YGP::IDirectorySearch::pEntry [protected] |
Pointer to (last) found File object.