Location:
f32file.h
Link against: efsrv.lib
CDirScan
Supported from 5.0
Scans a directory structure.
The scan moves from directory to directory through the hierarchy, returning a list of the entries contained in each. The order in which the directories are scanned is determined by a sort key which is specified when setting up the scan. The base directory to be scanned and the entry types of interest must also be specified before performing the scan.
This class is not intended for user derivation
|
Defined in CDirScan
:
AbbreviatedPath()
, EScanDownTree
, EScanUpTree
, FullPath()
, NewL()
, NewLC()
, NextL()
, SetScanDataL()
, TScanDirection
, ~CDirScan()
Inherited from CBase
:
operator new()
static CDirScan* NewL(RFs& aFs);
Constructs and allocates memory for a new CDirScan
object.
|
|
static CDirScan* NewLC(RFs& aFs);
Constructs and allocates memory for a new CDirScan
object — leaving object on cleanup stack. If construction is
successful, the object is placed on the clean-up stack before the function
returns.
|
|
void SetScanDataL(const TDesC& aMatchName,TUint anEntryAttMask,TUint anEntrySortMask,TScanDirection aScanDir=EScanDownTree);
Initialises the scan. This involves specifying:
the directory at the top of the structure to be scanned
a filter for the entry types of interest
the order in which the entries in each directory in the structure are to be sorted
the scan direction.
Whether the scan direction is upwards or downwards, the directories
which are scanned are those in the part of the hierarchy below the directory
specified in aMatchName
. By default, the scan direction is
downwards. If the scan direction is set to CDirScan::EScanUpTree
,
all branches of the tree are explored starting at the lowest level directory in
the tree below aMatchName
, and ending at aMatchName
.
This option is provided for deleting a directory
structure.
|
void NextL(CDir*& aDirEntries);
Scans the next directory entry in the structure.
The order in which the structure is scanned is determined by the scan direction and the entry sort mask. These values are specified when setting up the scan. The type of entries retrieved by this function is determined by the entry attribute mask. This is also specified when setting up the scan.
Notes:
The function first sets aDirEntries
to NULL, then
allocates memory for it before appending entries to it. Therefore,
aDirEntries
should have no memory allocated to it before this
function is called, otherwise this memory will become orphaned.
The caller of this function is responsible for deleting
aDirEntries
after the function has returned.
|
TPtrC AbbreviatedPath();
Returns the abbreviated path of the entry currently being scanned. The abbreviated path is the path relative to the top level directory in the scan.
|
TPtrC FullPath();
Returns the full path of the entry currently being scanned. The full path includes the drive letter.
|
TScanDirection
Scan direction
|