plptools
Loading...
Searching...
No Matches
Drive Class Reference

A class representing information about a Disk drive on the psion. More...

#include <drive.h>

Public Member Functions

 Drive ()
 Default constructor. More...
 
 Drive (MediaType mediaType, uint32_t driveAttributes, uint32_t mediaAttributes, uint32_t uid, uint64_t size, uint64_t space, char driveLetter, std::string name)
 
 Drive (const Drive &other)=default
 Copy constructor. More...
 
Driveoperator= (const Drive &other)=default
 Assignment operator. More...
 
MediaType getMediaType () const
 Retrieve the media type of the drive. More...
 
uint32_t getDriveAttributes () const
 Retrieve the attributes of the drive. More...
 
uint32_t getMediaAttributes () const
 Retrieve the attributes of the media. More...
 
uint32_t getUID () const
 Retrieve the UID of the drive. More...
 
uint64_t getSize () const
 Retrieve the total capacity of the drive. More...
 
uint64_t getSpace () const
 Retrieve the free capacity on the drive. More...
 
std::string getName () const
 Retrieve the volume name of the drive. More...
 
char getDriveLetter () const
 Retrieve the drive letter of the drive. More...
 
std::string getPath () const
 Get the file system path given by the current drive. More...
 

Private Member Functions

void setMediaType (MediaType type)
 
void setDriveAttributes (uint32_t driveAttribute)
 
void setMediaAttributes (uint32_t mediaAttribute)
 
void setUID (uint32_t uid)
 
void setSize (uint32_t sizeLo, uint32_t sizeHi)
 
void setSpace (uint32_t spaceLo, uint32_t spaceHi)
 
void setName (char drive, const char *const volname)
 

Private Attributes

MediaType mediaType_
 
uint32_t driveAttributes_
 
uint32_t mediaAttributes_
 
uint32_t uid_
 
uint64_t size_
 
uint64_t space_
 
char driveLetter_
 
std::string name_
 

Friends

class RFSV32
 
class RFSV16
 

Detailed Description

A class representing information about a Disk drive on the psion.

An Object of this type is used by RFSV::devinfo for returning the information of the probed drive.

Author
Fritz Elfert felfe.nosp@m.rt@t.nosp@m.o.com

Definition at line 51 of file drive.h.

Constructor & Destructor Documentation

◆ Drive() [1/3]

Drive::Drive ( )

Default constructor.

Definition at line 31 of file drive.cc.

◆ Drive() [2/3]

Drive::Drive ( MediaType  mediaType,
uint32_t  driveAttributes,
uint32_t  mediaAttributes,
uint32_t  uid,
uint64_t  size,
uint64_t  space,
char  driveLetter,
std::string  name 
)

Definition at line 34 of file drive.cc.

◆ Drive() [3/3]

Drive::Drive ( const Drive other)
default

Copy constructor.

Member Function Documentation

◆ getDriveAttributes()

uint32_t Drive::getDriveAttributes ( ) const

Retrieve the attributes of the drive.

Returns
The attributes of the probed drive.
Drive attributes are encoded by a number
in the range 0 .. 63. The bits have the
the following meaning:

  bit 0 = local
  bit 1 = ROM
  bit 2 = redirected
  bit 3 = substituted
  bit 4 = internal
  bit 5 = removable

Definition at line 86 of file drive.cc.

◆ getDriveLetter()

char Drive::getDriveLetter ( ) const

Retrieve the drive letter of the drive.

returns The letter of the probed drive.

Definition at line 110 of file drive.cc.

◆ getMediaAttributes()

uint32_t Drive::getMediaAttributes ( ) const

Retrieve the attributes of the media.

Returns
The attributes of the probed media.
Media attributes are encoded by a number
in the range 0 .. 15. The bits have the
following meaning:

  bit 0 = variable size
  bit 1 = dual density
  bit 2 = formattable
  bit 3 = write protected

Definition at line 90 of file drive.cc.

◆ getMediaType()

MediaType Drive::getMediaType ( ) const

Retrieve the media type of the drive.

Returns
The media type of the probed drive.
Media types are encoded by a number
in the range 0 .. 8 with the following
meaning:

  0 = Not present
  1 = Unknown
  2 = Floppy
  3 = Disk
  4 = CD-ROM
  5 = RAM
  6 = Flash Disk
  7 = ROM
  8 = Remote

Definition at line 82 of file drive.cc.

◆ getName()

string Drive::getName ( ) const

Retrieve the volume name of the drive.

returns The volume name of the drive.

Definition at line 106 of file drive.cc.

◆ getPath()

std::string Drive::getPath ( ) const

Get the file system path given by the current drive.

Returns
the full path of the current drive (e.g., "C:\\" for the drive "C").

Definition at line 114 of file drive.cc.

◆ getSize()

uint64_t Drive::getSize ( ) const

Retrieve the total capacity of the drive.

Returns
The capacity of the probed drive in bytes.

Definition at line 98 of file drive.cc.

◆ getSpace()

uint64_t Drive::getSpace ( ) const

Retrieve the free capacity on the drive.

Returns
The free space on the probed drive in bytes.

Definition at line 102 of file drive.cc.

◆ getUID()

uint32_t Drive::getUID ( ) const

Retrieve the UID of the drive.

Each drive, except the ROM drive on a Psion has a unique ID which can be retrieved here.

Returns
The UID of the probed drive.

Definition at line 94 of file drive.cc.

◆ operator=()

Drive & Drive::operator= ( const Drive other)
default

Assignment operator.

◆ setDriveAttributes()

void Drive::setDriveAttributes ( uint32_t  driveAttribute)
private

Definition at line 56 of file drive.cc.

◆ setMediaAttributes()

void Drive::setMediaAttributes ( uint32_t  mediaAttribute)
private

Definition at line 60 of file drive.cc.

◆ setMediaType()

void Drive::setMediaType ( MediaType  type)
private

Definition at line 52 of file drive.cc.

◆ setName()

void Drive::setName ( char  drive,
const char *const  volname 
)
private

Definition at line 76 of file drive.cc.

◆ setSize()

void Drive::setSize ( uint32_t  sizeLo,
uint32_t  sizeHi 
)
private

Definition at line 68 of file drive.cc.

◆ setSpace()

void Drive::setSpace ( uint32_t  spaceLo,
uint32_t  spaceHi 
)
private

Definition at line 72 of file drive.cc.

◆ setUID()

void Drive::setUID ( uint32_t  uid)
private

Definition at line 64 of file drive.cc.

Friends And Related Function Documentation

◆ RFSV16

friend class RFSV16
friend

Definition at line 53 of file drive.h.

◆ RFSV32

friend class RFSV32
friend

Definition at line 52 of file drive.h.

Member Data Documentation

◆ driveAttributes_

uint32_t Drive::driveAttributes_
private

Definition at line 192 of file drive.h.

◆ driveLetter_

char Drive::driveLetter_
private

Definition at line 197 of file drive.h.

◆ mediaAttributes_

uint32_t Drive::mediaAttributes_
private

Definition at line 193 of file drive.h.

◆ mediaType_

MediaType Drive::mediaType_
private

Definition at line 191 of file drive.h.

◆ name_

std::string Drive::name_
private

Definition at line 198 of file drive.h.

◆ size_

uint64_t Drive::size_
private

Definition at line 195 of file drive.h.

◆ space_

uint64_t Drive::space_
private

Definition at line 196 of file drive.h.

◆ uid_

uint32_t Drive::uid_
private

Definition at line 194 of file drive.h.


The documentation for this class was generated from the following files: