class TFindFile |
Searches for files and directories.
Each function has a variant which searches for multiple files/directories, using one or more wildcard characters in the filename. If an initial search is successful, further searches can be carried out using Find() or FindWild(). You can also retrieve the fully qualified file specification, and manipulate and interrogate it using the TParse class (or related classes).
Note that when specifying the path of a directory to search, the path should always end with a backslash character.When trailing backslash is not present then it is considered as file. And path will be taken till last backslash. The client must have appropriate capabilities for the directory to be searched. For example without ALL FILES Capability, it is not possible to successfully find any files under directory.
By default if the file is not found in the current drive the rest of the drives, excluding the remote ones, will be searched. Using function SetFindMask it is possible to specify a combination of drive attributes(aMask) that the drives to be searched must match.
Public Member Functions | |
---|---|
TFindFile(RFs &) | |
const TDesC & | File() |
IMPORT_C TInt | Find() |
IMPORT_C TInt | FindByDir(const TDesC &, const TDesC &) |
IMPORT_C TInt | FindByPath(const TDesC &, const TDesC *) |
IMPORT_C TInt | FindWild(CDir *&) |
IMPORT_C TInt | FindWildByDir(const TDesC &, const TDesC &, CDir *&) |
IMPORT_C TInt | FindWildByPath(const TDesC &, const TDesC *, CDir *&) |
IMPORT_C TInt | SetFindMask(TUint) |
Private Member Functions | |
---|---|
TInt | CallSafe(TInt) |
TInt | DoFind() |
TInt | DoFindByDir(const TDesC &, const TDesC &) |
TInt | DoFindByPath(const TDesC &, const TDesC *) |
TInt | DoFindInDir() |
TInt | DoFindNextInDriveList() |
TInt | DoFindNextInPath() |
Private Attributes | |
---|---|
TInt | iCurrentDrive |
CDir ** | iDir |
TDriveList | iDrvList |
TParse | iFile |
RFs *const | iFs |
TUint32 | iMatchMask |
TInt | iMode |
const TDesC * | iPath |
TInt | iPathPos |
TInt | DoFindByDir | ( | const TDesC & | aFileName, |
const TDesC & | aDir | |||
) | [private] |
TInt | DoFindByPath | ( | const TDesC & | aFileName, |
const TDesC * | aPathList | |||
) | [private] |
const TDesC & | File | ( | ) | const [inline] |
Gets the full file specification of a file which was found by a successful call to any of the search variants that do not accept wildcards.
The file specification includes drive, path and filename.
Notes:
1. When called after a successful search using wildcards the only valid components of the retrieved file specification are drive letter and directory.
The full path and filename.
IMPORT_C TInt | FindByDir | ( | const TDesC & | aFileName, |
const TDesC & | aDirPath | |||
) |
IMPORT_C TInt | FindByPath | ( | const TDesC & | aFileName, |
const TDesC * | aPathList | |||
) |
IMPORT_C TInt | FindWildByDir | ( | const TDesC & | aFileName, |
const TDesC & | aDirPath, | |||
CDir *& | aDir | |||
) |
IMPORT_C TInt | FindWildByPath | ( | const TDesC & | aFileName, |
const TDesC * | aPathList, | |||
CDir *& | aDirList | |||
) |