TDiskImage

From Ultibo.org
Jump to: navigation, search

Return to Unit Filesystem


Description


To be documented

Class definitions



TDiskImage = class(TListObject)

constructor Create(ADriver:TFileSysDriver; AController:TDiskController; const AName:String; AImageNo:Integer);  
destructor Destroy; override;  
private
FLock:TSynchronizerHandle;  
FLocalLock:TMutexHandle;  
protected
FDriver:TFileSysDriver;  
FController:TDiskController;  
 
FName:String;  
FImageNo:Integer;  
 
FLocked:Boolean;  
FChanged:Boolean;  
FAttributes:LongWord;  
 
FImageType:TImageType;  
FMediaType:TMediaType;  
FFloppyType:TFloppyType;  
 
FCylinders:LongWord; Physical Cylinders on Drive
FHeads:LongWord; Physical Heads on Drive
FSectors:LongWord; Physical Sectors per Track
FLogicalShiftCount:Word; Physical to Logical Shift Count
 
FSectorSize:Word; Bytes Per Sector
FSectorCount:Int64; Total Sectors
FSectorShiftCount:Word; Sectors to Bytes Shift Count
 
FPartitionId:Byte; Partition Type for Table
FFileSysType:TFileSysType;  
 
FDevice:TDiskDevice;  
 
function AcquireLock:Boolean;  
function ReleaseLock:Boolean;  
 
function GetReady:Boolean; virtual;  
function GetReadable:Boolean; virtual;  
function GetWriteable:Boolean; virtual;  
function GetEraseable:Boolean; virtual;  
 
function GetCylinders:LongWord; virtual;  
function GetHeads:LongWord; virtual;  
function GetSectors:LongWord; virtual;  
function GetLogicalShiftCount:Word; virtual;  
 
function GetSectorSize:Word; virtual;  
function GetSectorCount:Int64; virtual;  
function GetSectorShiftCount:Word; virtual;  
 
function GetPartitionId:Byte; virtual;  
 
function GetName:String; virtual;  
procedure SetName(const AName:String); virtual;  
procedure SetDevice(ADevice:TDiskDevice);  
public
property Controller:TDiskController read FController;  
 
property Name:String read GetName write SetName;  
property ImageNo:Integer read FImageNo;  
 
property Ready:Boolean read GetReady;  
property Locked:Boolean read FLocked;  
property Changed:Boolean read FChanged;  
property Readable:Boolean read GetReadable;  
property Writeable:Boolean read GetWriteable;  
property Eraseable:Boolean read GetEraseable;  
property Attributes:LongWord read FAttributes;  
 
property ImageType:TImageType read FImageType;  
property MediaType:TMediaType read FMediaType;  
property FloppyType:TFloppyType read FFloppyType;  
 
property Cylinders:LongWord read FCylinders;  
property Heads:LongWord read FHeads;  
property Sectors:LongWord read FSectors;  
property LogicalShiftCount:Word read FLogicalShiftCount;  
 
property SectorSize:Word read FSectorSize;  
property SectorCount:Int64 read FSectorCount;  
property SectorShiftCount:Word read FSectorShiftCount;  
 
property PartitionId:Byte read FPartitionId;  
property FileSysType:TFileSysType read FFileSysType;  
 
property Device:TDiskDevice read FDevice write SetDevice;  
 
function ReaderLock:Boolean;  
function ReaderUnlock:Boolean;  
function ReaderConvert:Boolean;  
function WriterLock:Boolean;  
function WriterUnlock:Boolean;  
function WriterConvert:Boolean;  
function WriterOwner:Boolean;  
 
function ImageInit:Boolean; virtual;  
 
function LockMedia:Boolean; virtual;  
function UnlockMedia:Boolean; virtual;  
function EjectMedia:Boolean; virtual;  
 
function MediaReady:Boolean; virtual;  
function MediaChanged:Boolean; virtual;  
function MediaLocked:Boolean; virtual;  
 
function Read(ASector:LongWord; ACount:Word; var ABuffer):Boolean; virtual;  
function Write(ASector:LongWord; ACount:Word; const ABuffer):Boolean; virtual;  
function Allocated(ASector:LongWord; ACount:Word):Word; virtual;  
 
function MountImage:Boolean; virtual;  
function DismountImage:Boolean; virtual;  
function InsertImage:Boolean; virtual;  
function EjectImage:Boolean; virtual;  
function ConvertImage(AImageType:TImageType):Boolean; virtual;  
function CopyImage(ADest:TDiskImage):Boolean; virtual;  
function ShrinkImage(const ASize:Int64):Boolean; virtual;  
function ExpandImage(const ASize:Int64):Boolean; virtual;  
 
function CreateImage(AMediaType:TMediaType; AFloppyType:TFloppyType; AAttributes:LongWord; ASectorSize:Word; const ASectorCount:Int64; ACylinders,AHeads,ASectors:LongWord; APartitionId:Byte):Integer; virtual;  
function OpenImage(AMediaType:TMediaType; AFloppyType:TFloppyType; AAttributes:LongWord; ASectorSize:Word; const ASectorCount:Int64; ACylinders,AHeads,ASectors:LongWord; APartitionId:Byte):Integer; virtual;  
function CloseImage:Boolean; virtual;  
function ResizeImage(const ASectorCount:Int64):Boolean; virtual;  
 
function CreateSnapshot:Boolean; virtual;  
function DeleteSnapshot:Boolean; virtual;  
function MergeSnapshot:Boolean; virtual;  


Function declarations



constructor TDiskImage.Create(ADriver:TFileSysDriver; AController:TDiskController; const AName:String; AImageNo:Integer);
Description: To be documented
Note None documented


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


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


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


function TDiskImage.GetReady:Boolean;
Description: To be documented
Note None documented


function TDiskImage.GetReadable:Boolean;
Description: To be documented
Note None documented


function TDiskImage.GetWriteable:Boolean;
Description: To be documented
Note None documented


function TDiskImage.GetEraseable:Boolean;
Description: To be documented
Note None documented


function TDiskImage.GetCylinders:LongWord;
Description: To be documented
Note None documented


function TDiskImage.GetHeads:LongWord;
Description: To be documented
Note None documented


function TDiskImage.GetSectors:LongWord;
Description: To be documented
Note None documented


function TDiskImage.GetLogicalShiftCount:Word;
Description: To be documented
Note None documented


function TDiskImage.GetSectorSize:Word;
Description: To be documented
Note None documented


function TDiskImage.GetSectorCount:Int64;
Description: To be documented
Note None documented


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


function TDiskImage.GetPartitionId:Byte;
Description: To be documented
Note None documented


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


procedure TDiskImage.SetName(const AName:String);
Description: To be documented
Note None documented


procedure TDiskImage.SetDevice(ADevice:TDiskDevice);
Description: Set the Device and Reinitialize the Device
Note None documented


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


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


function TDiskImage.ReaderConvert:Boolean;
Description: Convert a Reader lock to a Writer lock
Note None documented


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


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


function TDiskImage.WriterConvert:Boolean;
Description: Convert a Writer lock to a Reader lock
Note None documented


function TDiskImage.WriterOwner:Boolean;
Description: Return True if the current thread is the writer owner
Note None documented


function TDiskImage.ImageInit:Boolean;
Description: To be documented
Note None documented


function TDiskImage.LockMedia:Boolean;
Description: To be documented
Note None documented


function TDiskImage.UnlockMedia:Boolean;
Description: To be documented
Note None documented


function TDiskImage.EjectMedia:Boolean;
Description: To be documented
Note None documented


function TDiskImage.MediaReady:Boolean;
Description: To be documented
Note None documented


function TDiskImage.MediaChanged:Boolean;
Description: To be documented
Note None documented


function TDiskImage.MediaLocked:Boolean;
Description: To be documented
Note None documented


function TDiskImage.Read(ASector:LongWord; ACount:Word; var ABuffer):Boolean;
Description: To be documented
Note None documented


function TDiskImage.Write(ASector:LongWord; ACount:Word; const ABuffer):Boolean;
Description: To be documented
Note None documented


function TDiskImage.Allocated(ASector:LongWord; ACount:Word):Word;
Description: Used by Copier to determine allocated Sectors
Note None documented


function TDiskImage.MountImage:Boolean;
Description: To be documented
Note None documented


function TDiskImage.DismountImage:Boolean;
Description: To be documented
Note None documented


function TDiskImage.InsertImage:Boolean;
Description: To be documented
Note None documented


function TDiskImage.EjectImage:Boolean;
Description: To be documented
Note None documented


function TDiskImage.ConvertImage(AImageType:TImageType):Boolean;
Description: To be documented
Note None documented


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


function TDiskImage.ShrinkImage(const ASize:Int64):Boolean;
Description: To be documented
Note None documented


function TDiskImage.ExpandImage(const ASize:Int64):Boolean;
Description: To be documented
Note None documented


function TDiskImage.CreateImage(AMediaType:TMediaType; AFloppyType:TFloppyType; AAttributes:LongWord; ASectorSize:Word; const ASectorCount:Int64; ACylinders,AHeads,ASectors:LongWord; APartitionId:Byte):Integer;
Description: Used by Imager to perform Create Image
Note None documented


function TDiskImage.OpenImage(AMediaType:TMediaType; AFloppyType:TFloppyType; AAttributes:LongWord; ASectorSize:Word; const ASectorCount:Int64; ACylinders,AHeads,ASectors:LongWord; APartitionId:Byte):Integer;
Description: To be documented
Note None documented


function TDiskImage.CloseImage:Boolean;
Description: Used by Imager to perform Close Image
Note None documented


function TDiskImage.ResizeImage(const ASectorCount:Int64):Boolean;
Description: Used by Resizer to perform Shrink or Expand Image
Note None documented


function TDiskImage.CreateSnapshot:Boolean;
Description: Used by Imager to perform Create Snapshot
Note None documented


function TDiskImage.DeleteSnapshot:Boolean;
Description: Used by Imager to perform Delete Snapshot
Note None documented


function TDiskImage.MergeSnapshot:Boolean;
Description: Used by Imager to perform Merge Snapshot
Note None documented


Return to Unit Reference