Symbian
Symbian OS Library

SYMBIAN OS V9.3

[Index] [Spacer] [Previous] [Next]



Location: f32file.h
Link against: efsrv.lib

Class CDir

class CDir : public CBase;

Description

Array of directory entries that has been read into memory from the file system.

It can be read and sorted by user programs, but cannot be created by them.

Derivation

Members

Defined in CDir:
AddL(), CDir(), Compress(), Count(), ExtractL(), NewL(), Sort(), iArray, operator[](), ~CDir()

Inherited from CBase:
Delete(), Extension_(), operator new()


Construction and destruction


~CDir()

virtual IMPORT_C ~CDir();

Description

Destructor.

Frees all resources owned by the object, prior to its destruction.


CDir()

protected: IMPORT_C CDir();

Description

Default constructor.


NewL()

protected: static IMPORT_C CDir *NewL();

Description

Allocates and constructs a directory object.

This function is protected, which prevents objects of this class from being directly constructed.

Return value

CDir *

A pointer to the newly created object.

[Top]


Member functions


Count()

IMPORT_C TInt Count() const;

Description

Gets the number of entries in the array of directory entries.

Return value

TInt

The number of entries in the array.


operator[]()

IMPORT_C const TEntry &operator[](TInt anIndex) const;

Description

Gets an entry from the array of directory entries.

Parameters

TInt anIndex

of the desired entry within the array.

Return value

const TEntry &

A directory entry.


Sort()

IMPORT_C TInt Sort(TUint aEntrySortKey);

Description

Sorts the array of directory entries.

Parameters

TUint aEntrySortKey

A set of flags describing how the directory entries are to be sorted. The set of flags is defined by TEntryKey.

Return value

TInt

KErrNone, if successful, otherwise one of the other system-wide error codes.

See also:


AddL()

protected: IMPORT_C void AddL(const TEntry &anEntry);

Description

Adds the specified entry to the directory.

Note that the function can leave.

Parameters

const TEntry &anEntry

The directory entry to be added.


ExtractL()

protected: IMPORT_C void ExtractL(TBool aRemove, CDir *&aDir);

Description

Copies all directory entries from this directory array, and adds them to a new directory array.

The directory entries in this array can be deleted.

Note that the function can leave.

Parameters

TBool aRemove

If ETrue, the directory entries in this array are to be deleted after extraction; if EFalse, the directory entries are not to be deleted.

CDir *&aDir

On return, a pointer to a CDir object containing the extracted directory entries.


Compress()

protected: IMPORT_C void Compress();

Description

Compresses the directory.

This has the effect of potentially reducing the ammount of storage space required on the media for that directory and the files it contains. Some files are already compressed and will not compress further.

A potential side effect of compression is that each file is required to be uncompressed prior to use, generally increasing the time and processing cycles required to access that file.

[Top]


Member data


iArray

protected: CArrayPakFlat< TEntry > * iArray;

Description