Browse Source

+ implemented TOmfObjInput.CanReadObjData

git-svn-id: trunk@30864 -
nickysn 10 years ago
parent
commit
29a1c74e34
1 changed files with 15 additions and 0 deletions
  1. 15 0
      compiler/ogomf.pas

+ 15 - 0
compiler/ogomf.pas

@@ -121,6 +121,7 @@ interface
 
 
       TOmfObjInput = class(TObjInput)
       TOmfObjInput = class(TObjInput)
         constructor create;override;
         constructor create;override;
+        class function CanReadObjData(AReader:TObjectreader):boolean;override;
       end;
       end;
 
 
       { TMZExeOutput }
       { TMZExeOutput }
@@ -890,6 +891,20 @@ implementation
         cobjdata:=TOmfObjData;
         cobjdata:=TOmfObjData;
       end;
       end;
 
 
+    class function TOmfObjInput.CanReadObjData(AReader: TObjectreader): boolean;
+      var
+        b: Byte;
+      begin
+        result:=false;
+        if AReader.Read(b,sizeof(b)) then
+          begin
+            if b=RT_THEADR then
+            { TODO: check additional fields }
+              result:=true;
+          end;
+        AReader.Seek(0);
+      end;
+
 {****************************************************************************
 {****************************************************************************
                                TMZExeOutput
                                TMZExeOutput
 ****************************************************************************}
 ****************************************************************************}