Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

[Index] [Glossary] [Previous] [Next]



Location: f32file.h
Link against: efsrv.lib

Class TDriveUnit

TDriveUnit

Support

Supported from 5.0

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.

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


Construction and destruction


TDriveUnit()

TDriveUnit();

Description

Allows an uninitialised TDriveUnit to be constructed. It is necessary because there are also non-default constructors in this class.


TDriveUnit()

TDriveUnit(TInt aDrive);

Description

Constructor with a drive number. The drive number must be less than KMaxDrives or a panic occurs.

Parameters

TInt aDrive

The drive number.


TDriveUnit()

TDriveUnit(const TDesC& aDrive);

Description

Constructor with a drive letter. Trailing text within the descriptor is ignored.

Parameters

const TDesC& aDrive

Descriptor whose first character will be the drive letter. May be upper or lower case.

[Top]


Assignment operators


operator=()

TDriveUnit& operator=(TInt aDrive);

Description

Assigns a drive number to the drive unit. The drive number specified must be less than KMaxDrives or a panic occurs.

Parameters

TInt aDrive

The new drive number

Return value

TDriveUnit&

This drive unit


operator=()

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 occurs. Any trailing text within the descriptor is ignored.

Parameters

const TDesC& aDrive

Descriptor whose first character will be the drive letter. May be upper or lower case.

Return value

TDriveUnit&

This drive unit

[Top]


Conversion


TInt()

operator TInt() const;

Description

Converts the drive unit to an integer value.


Name()

TDriveName Name() const;

Description

Returns the drive unit as text.The drive letter is returned with a trailing colon.

Return value

TDriveName

Drive letter and colon