TFindFile Class Reference

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 TIntFind()
IMPORT_C TIntFindByDir(const TDesC &, const TDesC &)
IMPORT_C TIntFindByPath(const TDesC &, const TDesC *)
IMPORT_C TIntFindWild(CDir *&)
IMPORT_C TIntFindWildByDir(const TDesC &, const TDesC &, CDir *&)
IMPORT_C TIntFindWildByPath(const TDesC &, const TDesC *, CDir *&)
IMPORT_C TIntSetFindMask(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 *constiFs
TUint32 iMatchMask
TInt iMode
const TDesC *iPath
TInt iPathPos

Constructor & Destructor Documentation

TFindFile(RFs &)

IMPORT_CTFindFile(RFs &aFs)

Parameters

RFs & aFs

Member Functions Documentation

CallSafe(TInt)

TInt CallSafe(TIntaResult)[private]

Parameters

TInt aResult

DoFind()

TInt DoFind()[private]

DoFindByDir(const TDesC &, const TDesC &)

TInt DoFindByDir(const TDesC &aFileName,
const TDesC &aDir
)[private]

Parameters

const TDesC & aFileName
const TDesC & aDir

DoFindByPath(const TDesC &, const TDesC *)

TInt DoFindByPath(const TDesC &aFileName,
const TDesC *aPathList
)[private]

Parameters

const TDesC & aFileName
const TDesC * aPathList

DoFindInDir()

TInt DoFindInDir()[private]

DoFindNextInDriveList()

TInt DoFindNextInDriveList()[private]

DoFindNextInPath()

TInt DoFindNextInPath()[private]

File()

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.

Find()

IMPORT_C TIntFind()

FindByDir(const TDesC &, const TDesC &)

IMPORT_C TIntFindByDir(const TDesC &aFileName,
const TDesC &aDirPath
)

Parameters

const TDesC & aFileName
const TDesC & aDirPath

FindByPath(const TDesC &, const TDesC *)

IMPORT_C TIntFindByPath(const TDesC &aFileName,
const TDesC *aPathList
)

Parameters

const TDesC & aFileName
const TDesC * aPathList

FindWild(CDir *&)

IMPORT_C TIntFindWild(CDir *&aDirList)

Parameters

CDir *& aDirList

FindWildByDir(const TDesC &, const TDesC &, CDir *&)

IMPORT_C TIntFindWildByDir(const TDesC &aFileName,
const TDesC &aDirPath,
CDir *&aDir
)

Parameters

const TDesC & aFileName
const TDesC & aDirPath
CDir *& aDir

FindWildByPath(const TDesC &, const TDesC *, CDir *&)

IMPORT_C TIntFindWildByPath(const TDesC &aFileName,
const TDesC *aPathList,
CDir *&aDirList
)

Parameters

const TDesC & aFileName
const TDesC * aPathList
CDir *& aDirList

SetFindMask(TUint)

IMPORT_C TIntSetFindMask(TUintaMask)

Parameters

TUint aMask

Member Data Documentation

TInt iCurrentDrive

TInt iCurrentDrive[private]

CDir ** iDir

CDir **iDir[private]

TDriveList iDrvList

TDriveList iDrvList[private]

TParse iFile

TParse iFile[private]

RFs *const iFs

RFs *constiFs[private]

TUint32 iMatchMask

TUint32 iMatchMask[private]

TInt iMode

TInt iMode[private]

const TDesC * iPath

const TDesC *iPath[private]

TInt iPathPos

TInt iPathPos[private]