Symbian
Symbian OS Library

SYMBIAN OS V9.3

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



Location: f32file.h
Link against: efsrv.lib

Class TDriveUnit

class TDriveUnit;

Description

Drive numbers and letters.

A drive may be represented by either an integer between zero and twenty five inclusive, or by a buffer descriptor containing a character between "A" and "Z" inclusive, followed by a colon. This class encapsulates both representations. An instance of this class is constructed specifying either the drive number or the drive letter and may be converted between the two representations.

Members

Defined in TDriveUnit:
Name(), TDriveUnit(), TDriveUnit(), TDriveUnit(), operator TInt(), operator=(), operator=()


Construction and destruction


TDriveUnit()

inline TDriveUnit();

Description


TDriveUnit()

IMPORT_C TDriveUnit(TInt aDrive);

Description

Constructor taking a drive number.

Parameters

TInt aDrive

The drive number.

Panic codes

FSCLIENT

0 if aDrive is greater than or equal to KMaxDrives.

See also:


TDriveUnit()

IMPORT_C TDriveUnit(const TDesC &aDrive);

Description

Constructor taking a drive letter.

Parameters

const TDesC &aDrive

A descriptor containing text whose first character is the drive letter. Can be upper or lower case. Trailing text is ignored.

Panic codes

FSCLIENT

1 if the drive letter is invalid, i.e. does not correspond to a drive number.

[Top]


Member functions


operator=()

IMPORT_C TDriveUnit &operator=(TInt aDrive);

Description

Assigns the drive number to the drive unit

Parameters

TInt aDrive

The new drive number.

Return value

TDriveUnit &

A reference to this drive unit.

Panic codes

FSCLIENT

0 if aDrive is greater than or equal to KMaxDrives.

See also:


operator=()

IMPORT_C TDriveUnit &operator=(const TDesC &aDrive);

Description

Assigns a drive letter to the drive unit.

The letter must be between A and Z or a panic is raised. Any trailing text within the descriptor is ignored.

Parameters

const TDesC &aDrive

Descriptor containing text whose first character is the drive letter. It can be upper or lower case.

Return value

TDriveUnit &

A reference to this drive unit.

Panic codes

FSCLIENT

1 if the drive letter is invalid, i.e. does not correspond to a drive number.


operator TInt()

inline operator TInt() const;

Description

Converts the drive unit to an integer value.

Return value


Name()

IMPORT_C TDriveName Name() const;

Description

Gets the drive unit as text.

The drive letter is returned with a trailing colon.

Return value

TDriveName

The drive letter and a trailing colon.