Public Member Functions | |
SortedDirSearch (const std::string &search) | |
Searching | |
virtual const File * | find (const std::string &spec, unsigned long attribs=IDirectorySearch::FILE_NORMAL) |
virtual const File * | find (unsigned long attribs=IDirectorySearch::FILE_NORMAL) |
virtual const File * | next () |
Static Protected Member Functions | |
static bool | compareFiles (const File *a, const File *b) |
This search can be restricted to files matching certain name-criterias or by attributes.
The name-part of the files to search supports UNIX-like wildcards; that are the asterisk (*) for any number of any characters, the question-mark for any single character and a set of characters in brackets (([) and (])). This set can contain a list of characters (like [abcde]) or a region (like [a-e]). To invert this set use a leading caret (^) or a leading exclamation mark (!), like ([^a-e]).
The found (and matching) files are retrieved by objects of type File.
The result of the search is sorted alphabetically (by default; this can be changed to either size or last-access time).
YGP::SortedDirSearch< Parent >::SortedDirSearch | ( | const std::string & | search | ) | [inline] |
Constructor from a search-string.
search | Files to search for |
static bool YGP::SortedDirSearch< Parent >::compareFiles | ( | const File * | a, | |
const File * | b | |||
) | [inline, static, protected] |
Method to find the next file matching the previously specified values.
virtual const File* YGP::SortedDirSearch< Parent >::find | ( | unsigned long | attribs = IDirectorySearch::FILE_NORMAL |
) | [inline, virtual] |
Searches for previously specified files with the passed attributes.
attribs | Attributes the searched files must have |
virtual const File* YGP::SortedDirSearch< Parent >::find | ( | const std::string & | spec, | |
unsigned long | attribs = IDirectorySearch::FILE_NORMAL | |||
) | [inline, virtual] |
Returns the first found file matching spec
, having the attributes attribs
.
spec,: | Files to search for | |
attribs,: | Attributes the searched files must have attribs |
virtual const File* YGP::SortedDirSearch< Parent >::next | ( | ) | [inline, virtual] |
Method to find the next file matching the previously specified values.