VCF::Directory::Finder Class Reference
A Finder object is used to iterate a set of files contained in a Directory object that represents the directory. More...
#include <Directory.h>
Inheritance diagram for VCF::Directory::Finder:

Public Types | |
| enum | DisplayMode { dmNone = 0x0, dmFiles = 0x1, dmDirs = 0x2, dmAny = dmFiles | dmDirs } |
Public Member Functions | |
| virtual | ~Finder () |
| File * | getCurrentElement () const |
| Gets the pointer to the last searched element. | |
| bool | nextElement () |
| Advances the finder to the next element in the search. | |
| void | reset () |
| Resets the search. | |
| bool | hasMoreElements () const |
| Are there any more elements in this Finder ? This function doesn't affect the search in any way. | |
| Directory * | getOwningDirectory () |
| Returns the Directory object that created. | |
| void | setDisplayMode (DisplayMode displayMode) |
| set flags for DisplayMode enabled It can be set for files ( dmFiles ) or dirs ( dmDirs ) or both ( dmAny ). | |
| DisplayMode | getDisplayMode () const |
| Tells the current display mode. | |
| void | setDisplayOrder (DisplayMode displayOrder) |
| Set the order used by the Finder for displaying files and directories. | |
| DisplayMode | getDisplayOrder () const |
| Tells the order used by the Finder for displaying files and directories. | |
| void | setRecursion (const bool &recurse, const int &recursionLevelMax=-1) |
| Sets the Directory::Finder for recursion into subdirectories. | |
| bool | getRecurse () const |
| Tells if the Finder is set for recursion into suybdirectories. | |
| int | getRecursionLevelMax () const |
| Gets the maximum subdirectory level the Finder is allowed to recurse into, 0 means no recursion. | |
| void | setRecursionLevelMax (const int &recursionLevelMax) |
| Sets the maximum subdirectory level up to where the Finder is allowed to recurse into. | |
| int | getRecursionLevel () const |
| Gets the current subdirectory level where the Finder is currently recursing into, 0 is the root level of the search. | |
| void | internal_updateToActiveFinder () |
| Not meant for general consumption. | |
| String | getRelativePathToRootSearch () const |
| Gets the relative path of the file to the directory where the search started. | |
| void | setRelativePathToRootSearch (const String &val) |
| void | setSearchFilterFileObject (FileSearchFilter *searchFilterFileObject, const bool &ownFilterFileObject=false) |
| sets the search filter used with files by this Finder. | |
| FileSearchFilter * | getSearchFilterFileObject () const |
| Returns the search filter used with files by this Finder. | |
| void | setMaskFilterFileAttribs (File::FileAttributes maskFilterFileAttribs) |
| Set the file attributes mask used to limit the search for files ( not directories ). | |
| File::FileAttributes | getMaskFilterFileAttribs () const |
| Gets the file attributes mask used to limit the search for files ( not directories ). | |
| void | setStatMask (uint32 statMask) |
| Sets the mask for the informations we want to extract from a file. | |
| uint32 | getStatMask () const |
| Gets the mask for the informations we want to extract from a file. | |
| void | ignoreStat (uint32 ignoreMask) |
| Sets the mask for the informations we just don't care about. | |
| void | setShowLocalTime (const bool &showLocalTime) |
| stets the Finder for showing the local time of any file found. | |
| bool | getShowLocalTime () |
| tells if the Finder is set for showing the local time of any file found, or UTC time instead. | |
| void | setKeepOSSpecificFormat (const bool &keepOSSpecificFormat=true) |
| set the finder to always return filenames in the OS specific format | |
| bool | getKeepOSSpecificFormat () const |
| tells if we keep currently keep the filenames format OS specific | |
| virtual void | setAllowSpecialDirs (const bool &allowSpecialDirs) |
| enables/disable the visibility of some special directories during the search Under Windows these are indicated with dots ( '. | |
| bool | getAllowSpecialDirs () const |
| tells if the search is enabled for retrieving some special directories Under Windows these are indicated with dots ( '. | |
| File & | getFileInfo () |
| const File & | getFileInfo () const |
| DisplayMode | getCurrentDisplayOrder () const |
| void | setCurrentDisplayOrder (const DisplayMode &mode) |
| bool | canRecurseDown () const |
| void | setCurrentElement (File *file) |
| void | setParentFinder (Finder *finder, const String &relPath, const int &previousRecursionLevel) |
| void | goDownDir (File *file) |
| void | goUpDir (File *file) |
| void | continueSearch (File *file) |
Protected Member Functions | |
| Finder (Directory *directoryToSearch, FileSearchFilter *filterFileObject=NULL, const bool &ownFilterFileObject=false) | |
Protected Attributes | |
| File | fileInfos_ |
| Directory * | owningDirectory_ |
| the directory File owning this finder | |
| FileSearchFilter * | searchFilterFileObject_ |
| bool | ownFilterFileObject_ |
| File::FileAttributes | maskFilterFileAttribs_ |
| uint32 | statMask_ |
| File * | currentElement_ |
| The current element retrieved by the search. | |
| bool | searchHasMoreElements_ |
| Simply used to know if we have more elements. | |
| DisplayMode | displayMode_ |
| The display mode requested by the user. | |
| DisplayMode | displayOrder_ |
| The display order requested by the user. | |
| DisplayMode | displayOrderCurrent_ |
| The display order currently in use. | |
| bool | allowSpecialDirs_ |
| bool | showLocalTime_ |
| bool | keepOSSpecificFormat_ |
| bool | recurse_ |
| String | relativePathToRootSearch_ |
| the relative path to where the search started, while in the current subdirectories | |
| Finder * | rootSearchFinder_ |
| The main finder. | |
| Finder * | activeFinder_ |
| pointer to the finder currently active in the search | |
| Finder * | childFinder_ |
| Pointer to finder used to manage the search along the directory tree. | |
| Finder * | parentFinder_ |
| Pointer to finder used to manage the search along the directory tree. | |
| std::vector< Directory * > * | subdirs_ |
| memory finders' management. | |
| std::vector< Finder * > * | subfinders_ |
| int | recursionLevel_ |
| current recursion level | |
| int | recursionLevelMax_ |
| max allowed recursion level | |
| bool | goSearchAgain_ |
| for recursion: when we complete the search by dir and we want to search the files or viceversa. | |
Friends | |
| class | Directory |
Detailed Description
A Finder object is used to iterate a set of files contained in a Directory object that represents the directory.Only Directory objects may create a Finder object.
A Finder is similar to an Enumerator but it doesn't follow the exact same pattern. Specifically it doesn't allow you to go "backwards" - you can only reset the finder, and then progress to the next element. The most import method for iterating the elements in a Finder isntance is the nextElement() function which returns a pointer to an internal File object which is updated for each file element.
All the other methods are used to narrow or speed up the search. Custom filtering can be done the simple way by specifying filter strings, or in a fully flexible way through any class derived from FileSearchFilter.
Member Enumeration Documentation
|
|
|
Constructor & Destructor Documentation
|
|
|
|
||||||||||||||||
|
|
Member Function Documentation
|
|
|
|
|
|
|
|
tells if the search is enabled for retrieving some special directories Under Windows these are indicated with dots ( '. ' and '..' ) but they could be others under different OS
|
|
|
|
|
|
Gets the pointer to the last searched element.
|
|
|
Tells the current display mode.
|
|
|
Tells the order used by the Finder for displaying files and directories.
|
|
|
|
|
|
|
|
|
tells if we keep currently keep the filenames format OS specific
|
|
|
Gets the file attributes mask used to limit the search for files ( not directories ).
|
|
|
Returns the Directory object that created. this Finder.
|
|
|
Tells if the Finder is set for recursion into suybdirectories.
|
|
|
Gets the current subdirectory level where the Finder is currently recursing into, 0 is the root level of the search.
|
|
|
Gets the maximum subdirectory level the Finder is allowed to recurse into, 0 means no recursion.
|
|
|
Gets the relative path of the file to the directory where the search started.
|
|
|
Returns the search filter used with files by this Finder.
|
|
|
tells if the Finder is set for showing the local time of any file found, or UTC time instead.
|
|
|
Gets the mask for the informations we want to extract from a file.
|
|
|
|
|
|
|
|
|
Are there any more elements in this Finder ? This function doesn't affect the search in any way.
|
|
|
Sets the mask for the informations we just don't care about.
|
|
|
Not meant for general consumption. This is meant for implementors only. Don't call this method, or world wide evils will be unleashed that even Lara Croft will be powerless to stop. |
|
|
Advances the finder to the next element in the search.
|
|
|
Resets the search.
|
|
|
enables/disable the visibility of some special directories during the search Under Windows these are indicated with dots ( '. ' and '..' )
|
|
|
|
|
|
|
|
|
set flags for DisplayMode enabled It can be set for files ( dmFiles ) or dirs ( dmDirs ) or both ( dmAny ). If it is set for files, the finder will still be able to recurse into subdirectories if specified. Do not modify the display mode during the search unless you know what you are doing.
|
|
|
Set the order used by the Finder for displaying files and directories. The possible modes are: to display files first ( dmFiles ) and then directories; or vice-versa ( dmDirs ) in two search steps; or to display both of them, unsorted, in only one search step ( dmAny ).
|
|
|
set the finder to always return filenames in the OS specific format
|
|
|
Set the file attributes mask used to limit the search for files ( not directories ).
|
|
||||||||||||||||
|
|
|
||||||||||||
|
Sets the Directory::Finder for recursion into subdirectories.
|
|
|
Sets the maximum subdirectory level up to where the Finder is allowed to recurse into.
|
|
|
|
|
||||||||||||
|
sets the search filter used with files by this Finder.
|
|
|
stets the Finder for showing the local time of any file found. By default it shows the UTC time.
|
|
|
Sets the mask for the informations we want to extract from a file. This filter is meant to increase the performance, but be careful: this speed up the search significantly, but then if later you'll frequently need of the infos you choosed to exclude, then the performance will end up to be worse.
|
Friends And Related Function Documentation
|
|
|
Member Data Documentation
|
|
pointer to the finder currently active in the search
|
|
|
|
|
|
Pointer to finder used to manage the search along the directory tree.
|
|
|
The current element retrieved by the search.
|
|
|
The display mode requested by the user.
|
|
|
The display order requested by the user.
|
|
|
The display order currently in use.
|
|
|
|
|
|
for recursion: when we complete the search by dir and we want to search the files or viceversa.
|
|
|
|
|
|
|
|
|
|
|
|
the directory File owning this finder
|
|
|
Pointer to finder used to manage the search along the directory tree.
|
|
|
|
|
|
current recursion level
|
|
|
max allowed recursion level
|
|
|
the relative path to where the search started, while in the current subdirectories
|
|
|
The main finder. The same finder accessible to the user during all the search loop. |
|
|
|
|
|
Simply used to know if we have more elements.
|
|
|
|
|
|
|
|
|
memory finders' management. This vector is allocated only in the main finder rootSearchFinder_ |
|
|
|
The documentation for this class was generated from the following file:
- vcf/FoundationKit/Directory.h
