YGP::SortedDirSearch< Parent > Class Template Reference

Class to search for files in a certain directory. More...

List of all members.

Public Member Functions

 SortedDirSearch (const std::string &search)
Searching
virtual const Filefind (const std::string &spec, unsigned long attribs=IDirectorySearch::FILE_NORMAL)
virtual const Filefind (unsigned long attribs=IDirectorySearch::FILE_NORMAL)
virtual const Filenext ()

Static Protected Member Functions

static bool compareFiles (const File *a, const File *b)


Detailed Description

template<class Parent = YGP::DirectorySearch>
class YGP::SortedDirSearch< Parent >

Class to search for files in a certain directory.

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).


Constructor & Destructor Documentation

template<class Parent = YGP::DirectorySearch>
YGP::SortedDirSearch< Parent >::SortedDirSearch ( const std::string &  search  )  [inline]

Constructor from a search-string.

Parameters:
search Files to search for


Member Function Documentation

template<class Parent = YGP::DirectorySearch>
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.

Returns:
const File* Pointer to found file or NULL

template<class Parent = YGP::DirectorySearch>
virtual const File* YGP::SortedDirSearch< Parent >::find ( unsigned long  attribs = IDirectorySearch::FILE_NORMAL  )  [inline, virtual]

Searches for previously specified files with the passed attributes.

Parameters:
attribs Attributes the searched files must have
Returns:
const File* Pointer to found file or NULL

template<class Parent = YGP::DirectorySearch>
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.

Parameters:
spec,: Files to search for
attribs,: Attributes the searched files must have attribs

template<class Parent = YGP::DirectorySearch>
virtual const File* YGP::SortedDirSearch< Parent >::next (  )  [inline, virtual]

Method to find the next file matching the previously specified values.

Returns:
const File* Pointer to found file or NULL


The documentation for this class was generated from the following file:

YGP Version 0.9.31 - Generated on Wed Nov 18 11:25:28 2009 by doxygen 1.5.8