TDiskVolume

From Ultibo.org
Jump to: navigation, search

Return to Unit Filesystem


Description


To be documented

Class definitions



TDiskVolume = class(TListObject)

constructor Create(ADriver:TFileSysDriver; ADevice:TDiskDevice; APartition:TDiskPartition; AVolumeNo:Integer);  
destructor Destroy; override;  
private
FLock:TSynchronizerHandle;  
FLocalLock:TMutexHandle;  
protected
FDriver:TFileSysDriver;  
FDevice:TDiskDevice;  
FPartition:TDiskPartition;  
 
FVolumeNo:Integer; \Volume1 , \Volume2, etc - See Notes
FSegmentNo:Integer; Segment0, Segment1 etc - for Multiple Segment volumes (eg Netware)
 
FDriveType:TDriveType;  
 
FFileSystem:TFileSystem;  
 
FRemovable:Boolean; Volume is Removable - Set by VolumeInit
FRecognizable:Boolean; Volume allows Recognize Volume
FRecognized:Boolean; Recognized Volume - Set by Recognizer
 
FSectorSize:Word; Sector Size of Device
FStartSector:Int64; Absolute Start Sector on Device
FSectorCount:LongWord; Total Sectors in Volume
FSectorShiftCount:Word; Sectors to Bytes Shift Count
 
function AcquireLock:Boolean;  
function ReleaseLock:Boolean;  
 
function GetName:String;  
function GetParent:String;  
 
function GetMaxFile:Integer;  
function GetMaxPath:Integer;  
function GetAttributes:LongWord;  
function GetSystemName:String;  
function GetVolumeName:String;  
function GetVolumeGUID:String;  
function GetVolumeSerial:LongWord;  
function GetFileSysType:TFileSysType;  
 
procedure SetFileSystem(AFileSystem:TFileSystem);  
 
function GetSectorSize:Word;  
function GetStartSector:Int64;  
function GetSectorCount:LongWord;  
function GetSectorShiftCount:Word;  
 
function MediaTypeToDriveType(AMediaType:TMediaType):TDriveType;  
 
function GetBootRecord(ARecord:Pointer,ASector:LongWord):Boolean; virtual;  
function SetBootRecord(ARecord:Pointer,ASector:LongWord):Boolean; virtual;  
public
property Name:String read GetName;  
property Parent:String read GetParent;  
property Device:TDiskDevice read FDevice;  
property Partition:TDiskPartition read FPartition;  
property VolumeNo:Integer read FVolumeNo;  
property SegmentNo:Integer read FSegmentNo;  
 
property MaxFile:Integer read GetMaxFile;  
property MaxPath:Integer read GetMaxPath;  
property Attributes:LongWord read GetAttributes;  
property SystemName:String read GetSystemName;  
property VolumeName:String read GetVolumeName;  
property VolumeGUID:String read GetVolumeGUID;  
property VolumeSerial:LongWord read GetVolumeSerial;  
 
property DriveType:TDriveType read FDriveType;  
property FileSysType:TFileSysType read GetFileSysType;  
 
property FileSystem:TFileSystem read FFileSystem write SetFileSystem;  
 
property Removable:Boolean read FRemovable;  
property Recognizable:Boolean read FRecognizable;  
property Recognized:Boolean read FRecognized write FRecognized;  
 
property SectorSize:Word read GetSectorSize;  
property StartSector:Int64 read GetStartSector;  
property SectorCount:LongWord read GetSectorCount;  
property SectorShiftCount:Word read GetSectorShiftCount;  
 
function ReaderLock:Boolean;  
function ReaderUnlock:Boolean;  
function WriterLock:Boolean;  
function WriterUnlock:Boolean;  
 
function VolumeInit:Boolean; virtual;  
 
function CreateDrive(ADriveNo:Integer):TDiskDrive; virtual;  
function DeleteDrive(ADrive:TDiskDrive):Boolean; virtual;  
 
function MountVolume(ADriveNo:Integer):Boolean; virtual;  
function DismountVolume:Boolean; virtual;  
function FormatVolume(AFloppyType:TFloppyType; AFileSysType:TFileSysType):Boolean; virtual;  
function DefragmentVolume:Boolean; virtual;  
function ConvertVolume(AFileSysType:TFileSysType):Boolean; virtual;  
function RepairVolume:Boolean; virtual;  
function CopyVolume(ADest:TDiskVolume):Boolean; virtual;  
function ShrinkVolume(const AStart,ASize:Int64):Boolean; virtual;  
function ExpandVolume(const AStart,ASize:Int64):Boolean; virtual;  
 
function OpenVolume(AMode:Integer):Integer; virtual;  
procedure CloseVolume(AHandle:Integer); virtual;  
function ReadVolume(AHandle:Integer; var ABuffer; ACount:Integer):Integer; virtual;  
function WriteVolume(AHandle:Integer; const ABuffer; ACount:Integer):Integer; virtual;  
function SeekVolume(AHandle:Integer; const AOffset:Int64; AOrigin:Integer):Int64; virtual;  


Function declarations



constructor TDiskVolume.Create(ADriver:TFileSysDriver; ADevice:TDiskDevice; APartition:TDiskPartition; AVolumeNo:Integer);
Description: To be documented
Note None documented


destructor TDiskVolume.Destroy;
Description: To be documented
Note None documented


function TDiskVolume.AcquireLock:Boolean;
Description: To be documented
Note None documented


function TDiskVolume.ReleaseLock:Boolean;
Description: To be documented
Note None documented


function TDiskVolume.GetName:String;
Description: To be documented
Note None documented


function TDiskVolume.GetParent:String;
Description: To be documented
Note None documented


function TDiskVolume.GetMaxFile:Integer;
Description: Get MaxFile from FileSystem if Mounted
Note None documented


function TDiskVolume.GetMaxPath:Integer;
Description: Get MaxPath from FileSystem if Mounted
Note None documented


function TDiskVolume.GetAttributes:LongWord;
Description: Get Attributes from FileSystem if Mounted
Note None documented


function TDiskVolume.GetSystemName:String;
Description: Get SystemName from FileSystem if Mounted
Note None documented


function TDiskVolume.GetVolumeName:String;
Description: Get VolumeName from FileSystem if Mounted
Note None documented


function TDiskVolume.GetVolumeGUID:String;
Description: Get VolumeGUID from FileSystem if Mounted
Note None documented


function TDiskVolume.GetVolumeSerial:LongWord;
Description: Get VolumeSerial from FileSystem if Mounted
Note None documented


function TDiskVolume.GetFileSysType:TFileSysType;
Description: Get FileSysType from FileSystem if Mounted
Note None documented


procedure TDiskVolume.SetFileSystem(AFileSystem:TFileSystem);
Description: Set the FileSystem and Reinitialize the Volume
Note None documented


function TDiskVolume.GetSectorSize:Word;
Description: Get SectorSize from FileSystem (Mounted) or Volume (Not Mounted)
Note None documented


function TDiskVolume.GetStartSector:Int64;
Description: Get StartSector from FileSystem (Mounted) or Volume (Not Mounted)
Note None documented


function TDiskVolume.GetSectorCount:LongWord;
Description: Get SectorCount from FileSystem (Mounted) or Volume (Not Mounted)
Note None documented


function TDiskVolume.GetSectorShiftCount:Word;
Description: To be documented
Note None documented


function TDiskVolume.MediaTypeToDriveType(AMediaType:TMediaType):TDriveType;
Description: To be documented
Note None documented


function TDiskVolume.ReaderLock:Boolean;
Description: To be documented
Note None documented


function TDiskVolume.ReaderUnlock:Boolean;
Description: To be documented
Note None documented


function TDiskVolume.WriterLock:Boolean;
Description: To be documented
Note None documented


function TDiskVolume.WriterUnlock:Boolean;
Description: To be documented
Note None documented


function TDiskVolume.VolumeInit:Boolean;
Description: To be documented
Note None documented


function TDiskVolume.CreateDrive(ADriveNo:Integer):TDiskDrive;
Description: To be documented
Note None documented


function TDiskVolume.DeleteDrive(ADrive:TDiskDrive):Boolean;
Description: To be documented
Note Caller must hold the drive writer lock


function TDiskVolume.MountVolume(ADriveNo:Integer):Boolean;
Description: To be documented
Note None documented


function TDiskVolume.DismountVolume:Boolean;
Description: To be documented
Note None documented


function TDiskVolume.FormatVolume(AFloppyType:TFloppyType; AFileSysType:TFileSysType):Boolean;
Description: To be documented
Note None documented


function TDiskVolume.DefragmentVolume:Boolean;
Description: To be documented
Note None documented


function TDiskVolume.ConvertVolume(AFileSysType:TFileSysType):Boolean;
Description: To be documented
Note None documented


function TDiskVolume.RepairVolume:Boolean;
Description: To be documented
Note None documented


function TDiskVolume.CopyVolume(ADest:TDiskVolume):Boolean;
Description: To be documented
Note Caller must hold the dest writer lock


function TDiskVolume.ShrinkVolume(const AStart,ASize:Int64):Boolean;
Description: To be documented
Note None documented


function TDiskVolume.ExpandVolume(const AStart,ASize:Int64):Boolean;
Description: To be documented
Note None documented


function TDiskVolume.OpenVolume(AMode:Integer):Integer;
Description: To be documented
Note None documented


procedure TDiskVolume.CloseVolume(AHandle:Integer);
Description: To be documented
Note None documented


function TDiskVolume.ReadVolume(AHandle:Integer; var ABuffer; ACount:Integer):Integer;
Description: To be documented
Note Raw Reads must be in Sector sized multiples


function TDiskVolume.WriteVolume(AHandle:Integer; const ABuffer; ACount:Integer):Integer;
Description: To be documented
Note Raw Writes must be in Sector sized multiples


function TDiskVolume.SeekVolume(AHandle:Integer; const AOffset:Int64; AOrigin:Integer):Int64;
Description: To be documented
Note Raw Seeks must be in Sector sized multiples

Raw Seeks cannot extend the size of the Volume


Return to Unit Reference