Inherits YGP::DirectorySearch.
Public Member Functions | |
void | setPath (const std::string &newPath) |
Section manager-functions | |
PathDirectorySearch () | |
PathDirectorySearch (const std::string &srcPath) | |
PathDirectorySearch (const std::string &srcPath, const std::string &search) | |
virtual | ~PathDirectorySearch () |
Searching | |
const File * | find (const std::string &path, const std::string &search, unsigned long attribs=FILE_NORMAL) |
const File * | find (const std::string &search, unsigned long attribs=FILE_NORMAL) |
virtual const File * | find (unsigned long attribs=FILE_NORMAL) |
virtual const File * | next () |
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.
Note: The class does not do any word expansion for the search-path (like expanding the tilde (~) to the home-directory)!
YGP::PathDirectorySearch::PathDirectorySearch | ( | ) | [inline] |
Default constructur; creates an empty object, not ready to search for files.
YGP::PathDirectorySearch::PathDirectorySearch | ( | const std::string & | srcPath | ) | [inline] |
Constructur; creates an object with an path to files in.
srcPath | Path to search files in |
YGP::PathDirectorySearch::PathDirectorySearch | ( | const std::string & | srcPath, | |
const std::string & | search | |||
) | [inline] |
Constructur; creates an object with a path to files in and the files to search for.
path | srcPath to search files in | |
search | Specification of files to search in path |
YGP::PathDirectorySearch::~PathDirectorySearch | ( | ) | [virtual] |
Destructor.
const File * YGP::PathDirectorySearch::find | ( | unsigned long | attribs = FILE_NORMAL |
) | [virtual] |
Searches for first file matching the input specified by the constructor(s) or the set-methods.
If a search within a node of the path returns an error, continue with the next node.
attribs | Attributes the file must contain |
Reimplemented from YGP::DirectorySearch.
const File* YGP::PathDirectorySearch::find | ( | const std::string & | search, | |
unsigned long | attribs = FILE_NORMAL | |||
) | [inline] |
Searches for the specified files with the passed attributes in all the nodes specified by path
.
Reimplemented from YGP::DirectorySearch.
const File* YGP::PathDirectorySearch::find | ( | const std::string & | path, | |
const std::string & | search, | |||
unsigned long | attribs = FILE_NORMAL | |||
) | [inline] |
Searches for the specified files with the passed attributes in all the nodes specified by path
.
const File * YGP::PathDirectorySearch::next | ( | ) | [virtual] |
Returns the next matching file according to parameters specified in earlier find-calls.
If a search within a node of the path returns an error, continue with the next node.
Reimplemented from YGP::DirectorySearch.
void YGP::PathDirectorySearch::setPath | ( | const std::string & | newPath | ) | [inline] |
Sets/Changes the path to search in.