فهرست منبع

* return the correct size for files in ar archive. This is required by the REL
reader, which reads files until the end of file

git-svn-id: trunk@45558 -

nickysn 5 سال پیش
والد
کامیت
d0beacc35f
2فایلهای تغییر یافته به همراه16 افزوده شده و 1 حذف شده
  1. 7 0
      compiler/owar.pas
  2. 9 1
      compiler/owbase.pas

+ 7 - 0
compiler/owar.pas

@@ -75,6 +75,7 @@ type
     procedure ReadArchive;
     procedure ReadArchive;
   protected
   protected
     function getfilename:string;override;
     function getfilename:string;override;
+    function GetSize: longint;override;
     function GetPos: longint;override;
     function GetPos: longint;override;
     function GetIsArchive: boolean; override;
     function GetIsArchive: boolean; override;
   public
   public
@@ -366,6 +367,12 @@ implementation
       end;
       end;
 
 
 
 
+    function tarobjectreader.GetSize: longint;
+      begin
+        result:=CurrMemberSize;
+      end;
+
+
     function tarobjectreader.GetPos: longint;
     function tarobjectreader.GetPos: longint;
       begin
       begin
         result:=inherited GetPos-CurrMemberPos;
         result:=inherited GetPos-CurrMemberPos;

+ 9 - 1
compiler/owbase.pas

@@ -55,6 +55,8 @@ type
 
 
   tobjectwriterclass = class of tobjectwriter;
   tobjectwriterclass = class of tobjectwriter;
 
 
+  { tobjectreader }
+
   tobjectreader=class
   tobjectreader=class
   private
   private
     f      : TCCustomFileStream;
     f      : TCCustomFileStream;
@@ -66,6 +68,7 @@ type
     function readbuf:boolean;
     function readbuf:boolean;
   protected
   protected
     function getfilename : string;virtual;
     function getfilename : string;virtual;
+    function GetSize: longint;virtual;
     function GetPos: longint;virtual;
     function GetPos: longint;virtual;
     function GetIsArchive: boolean;virtual;
     function GetIsArchive: boolean;virtual;
   public
   public
@@ -78,7 +81,7 @@ type
     function  read(out b;len:longint):boolean;virtual;
     function  read(out b;len:longint):boolean;virtual;
     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 GetSize;
     property Pos:longint read GetPos;
     property Pos:longint read GetPos;
     property IsArchive: boolean read GetIsArchive;
     property IsArchive: boolean read GetIsArchive;
   end;
   end;
@@ -332,6 +335,11 @@ function tobjectreader.getfilename : string;
     result:=ffilename;
     result:=ffilename;
   end;
   end;
 
 
+function tobjectreader.GetSize: longint;
+  begin
+    result:=bufmax;
+  end;
+
 function tobjectreader.GetPos: longint;
 function tobjectreader.GetPos: longint;
   begin
   begin
     Result:=bufidx;
     Result:=bufidx;