+ added property tobjectreader.pos, which returns the current position when reading an object file

git-svn-id: trunk@31315 -
This commit is contained in:
nickysn 2015-08-11 15:46:44 +00:00
parent 515d702408
commit c3133c498a
3 changed files with 21 additions and 0 deletions

View File

@ -75,6 +75,7 @@ type
procedure ReadArchive;
protected
function getfilename:string;override;
function GetPos: longint;override;
public
constructor create(const Aarfn:string;allow_nonar:boolean=false);
destructor destroy;override;
@ -357,6 +358,12 @@ implementation
end;
function tarobjectreader.GetPos: longint;
begin
result:=inherited GetPos-CurrMemberPos;
end;
function tarobjectreader.DecodeMemberName(ahdr:TArHdr):string;
var
hs : string;

View File

@ -66,6 +66,7 @@ type
function readbuf:boolean;
protected
function getfilename : string;virtual;
function GetPos: longint;virtual;
public
constructor create;
destructor destroy;override;
@ -76,6 +77,7 @@ type
function readarray(a:TDynamicArray;len:longint):boolean;
property filename : string read getfilename;
property size:longint read bufmax;
property Pos:longint read GetPos;
end;
implementation
@ -310,4 +312,9 @@ function tobjectreader.getfilename : string;
result:=ffilename;
end;
function tobjectreader.GetPos: longint;
begin
Result:=bufidx;
end;
end.

View File

@ -81,6 +81,8 @@ type
FPageSize: Integer;
procedure ReadLibrary;
procedure ReadDictionary(DictionaryOffset: DWord; DictionarySizeInBlocks: Word);
protected
function GetPos: longint;override;
public
constructor create(const Aarfn:string;allow_nonar:boolean=false);
destructor destroy;override;
@ -399,6 +401,11 @@ implementation
end;
end;
function TOmfLibObjectReader.GetPos: longint;
begin
result:=inherited GetPos-CurrMemberPos;
end;
constructor TOmfLibObjectReader.create(const Aarfn: string; allow_nonar: boolean);
var
RecType: Byte;