home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2002 October
/
Chip_2002-10_cd1.bin
/
zkuste
/
delphi
/
kolekce
/
d56
/
FLEXCEL.ZIP
/
BiffEdit
/
UBiffData.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
2002-05-12
|
1KB
|
65 lines
unit UBiffData;
interface
uses classes;
type
TRecord= record
Id:word;
Size: int64;
IdName: string;
Data: string;
HexData: string;
Offset: int64;
Version: word; //only for Escher records
end;
PRecord=^TRecord;
TRecordList=class(TList)
private
function GetItem(Index: Integer): PRecord;
procedure SetItem(Index: Integer; const Value: PRecord);
protected
procedure Notify(Ptr: Pointer; Action: TListNotification); override;
property Items[Index: Integer]: PRecord read GetItem write SetItem; default;
end;
procedure CopyRecord (const Source, Dest: PRecord);
implementation
{ TRecordList }
function TRecordList.GetItem(Index: Integer): PRecord;
begin
Result:=PRecord(inherited Items[Index]);
end;
procedure TRecordList.Notify(Ptr: Pointer; Action: TListNotification);
begin
if Action = lnDeleted then
begin
//The cast to PRecord is to finalize strings
Dispose(PRecord(Ptr));
end;
inherited Notify(Ptr, Action);
end;
procedure TRecordList.SetItem(Index: Integer; const Value: PRecord);
begin
inherited Items[Index]:= value;
end;
procedure CopyRecord (const Source, Dest: PRecord);
begin
Dest.Id:=Source.Id;
Dest.Size:= Source.Size;
Dest.IdName:= Source.IdName;
Dest.Data:= Source.Data;
Dest.HexData:= Source.HexData;
Dest.Offset:= Source.Offset;
Dest.Version:=Source.Version;
end;
end.