mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-13 07:19:17 +02:00
+ added property tobjectreader.pos, which returns the current position when reading an object file
git-svn-id: trunk@31315 -
This commit is contained in:
parent
515d702408
commit
c3133c498a
@ -75,6 +75,7 @@ type
|
|||||||
procedure ReadArchive;
|
procedure ReadArchive;
|
||||||
protected
|
protected
|
||||||
function getfilename:string;override;
|
function getfilename:string;override;
|
||||||
|
function GetPos: longint;override;
|
||||||
public
|
public
|
||||||
constructor create(const Aarfn:string;allow_nonar:boolean=false);
|
constructor create(const Aarfn:string;allow_nonar:boolean=false);
|
||||||
destructor destroy;override;
|
destructor destroy;override;
|
||||||
@ -357,6 +358,12 @@ implementation
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
function tarobjectreader.GetPos: longint;
|
||||||
|
begin
|
||||||
|
result:=inherited GetPos-CurrMemberPos;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
function tarobjectreader.DecodeMemberName(ahdr:TArHdr):string;
|
function tarobjectreader.DecodeMemberName(ahdr:TArHdr):string;
|
||||||
var
|
var
|
||||||
hs : string;
|
hs : string;
|
||||||
|
@ -66,6 +66,7 @@ type
|
|||||||
function readbuf:boolean;
|
function readbuf:boolean;
|
||||||
protected
|
protected
|
||||||
function getfilename : string;virtual;
|
function getfilename : string;virtual;
|
||||||
|
function GetPos: longint;virtual;
|
||||||
public
|
public
|
||||||
constructor create;
|
constructor create;
|
||||||
destructor destroy;override;
|
destructor destroy;override;
|
||||||
@ -76,6 +77,7 @@ type
|
|||||||
function readarray(a:TDynamicArray;len:longint):boolean;
|
function readarray(a:TDynamicArray;len:longint):boolean;
|
||||||
property filename : string read getfilename;
|
property filename : string read getfilename;
|
||||||
property size:longint read bufmax;
|
property size:longint read bufmax;
|
||||||
|
property Pos:longint read GetPos;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
@ -310,4 +312,9 @@ function tobjectreader.getfilename : string;
|
|||||||
result:=ffilename;
|
result:=ffilename;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function tobjectreader.GetPos: longint;
|
||||||
|
begin
|
||||||
|
Result:=bufidx;
|
||||||
|
end;
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
@ -81,6 +81,8 @@ type
|
|||||||
FPageSize: Integer;
|
FPageSize: Integer;
|
||||||
procedure ReadLibrary;
|
procedure ReadLibrary;
|
||||||
procedure ReadDictionary(DictionaryOffset: DWord; DictionarySizeInBlocks: Word);
|
procedure ReadDictionary(DictionaryOffset: DWord; DictionarySizeInBlocks: Word);
|
||||||
|
protected
|
||||||
|
function GetPos: longint;override;
|
||||||
public
|
public
|
||||||
constructor create(const Aarfn:string;allow_nonar:boolean=false);
|
constructor create(const Aarfn:string;allow_nonar:boolean=false);
|
||||||
destructor destroy;override;
|
destructor destroy;override;
|
||||||
@ -399,6 +401,11 @@ implementation
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TOmfLibObjectReader.GetPos: longint;
|
||||||
|
begin
|
||||||
|
result:=inherited GetPos-CurrMemberPos;
|
||||||
|
end;
|
||||||
|
|
||||||
constructor TOmfLibObjectReader.create(const Aarfn: string; allow_nonar: boolean);
|
constructor TOmfLibObjectReader.create(const Aarfn: string; allow_nonar: boolean);
|
||||||
var
|
var
|
||||||
RecType: Byte;
|
RecType: Byte;
|
||||||
|
Loading…
Reference in New Issue
Block a user