TDriveUnit Class Reference

#include <f32file.h>

Link against: efsrv.lib

class TDriveUnit
Public Member Functions
TDriveUnit()
TDriveUnit(TInt)
TDriveUnit(const TDesC &)
IMPORT_C TDriveNameName()
operator TInt()
IMPORT_C TDriveUnit &operator=(TInt)
IMPORT_C TDriveUnit &operator=(const TDesC &)

Detailed 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.

Constructor & Destructor Documentation

TDriveUnit ( )

TDriveUnit()[inline]

TDriveUnit ( TInt )

IMPORT_CTDriveUnit(TIntaDrive)

Constructor taking a drive number.

See also: KMaxDrives

Parameters
aDriveThe drive number.
Panic Codes
FSCLIENT0 if aDrive is greater than or equal to KMaxDrives or less than 0.

TDriveUnit ( const TDesC & )

IMPORT_CTDriveUnit(const TDesC &aDrive)

Constructor taking a drive letter.

See also: RFs::CharToDrive

Parameters
aDriveA descriptor containing text whose first character is the drive letter. Can be upper or lower case. Trailing text is ignored.
Panic Codes
FSCLIENT1 if the drive letter is invalid, i.e. does not correspond to a drive number.

Member Function Documentation

Name ( )

IMPORT_C TDriveNameName()const

Gets the drive unit as text.

The drive letter is returned with a trailing colon.

Return Value
The drive letter and a trailing colon.
Panic Codes
FSCLIENT0 if

operator TInt ( )

operator TInt()const [inline]

Converts the drive unit to an integer value.

operator= ( TInt )

IMPORT_C TDriveUnit &operator=(TIntaDrive)

Assigns the drive number to the drive unit

See also: KMaxDrives

Parameters
aDriveThe new drive number.
Return Value
A reference to this drive unit.
Panic Codes
FSCLIENT0 if aDrive is greater than or equal to KMaxDrives.

operator= ( const TDesC & )

IMPORT_C TDriveUnit &operator=(const TDesC &aDrive)

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.

See also: RFs::CharToDrive

Parameters
aDriveDescriptor containing text whose first character is the drive letter. It can be upper or lower case.
Return Value
A reference to this drive unit.
Panic Codes
FSCLIENT1 if the drive letter is invalid, i.e. does not correspond to a drive number.