Browse Source

* stuff interface implementation data into contentfile.
Inheritance data is ignored but not processed while reading atm.

git-svn-id: trunk@15825 -

marco 15 years ago
parent
commit
8755a60e5c
1 changed files with 16 additions and 8 deletions
  1. 16 8
      utils/fpdoc/dglobals.pp

+ 16 - 8
utils/fpdoc/dglobals.pp

@@ -23,7 +23,7 @@ unit dGlobals;
 
 
 interface
 interface
 
 
-uses Classes, DOM, PasTree, PParser;
+uses Classes, DOM, PasTree, PParser, StrUtils;
 
 
 Var
 Var
   LEOL : Integer;
   LEOL : Integer;
@@ -637,12 +637,13 @@ var
 
 
   procedure ReadClasses;
   procedure ReadClasses;
 
 
-    function CreateClass(const AName: String): TPasClassType;
+    function CreateClass(const AName: String;InheritanceStr:String): TPasClassType;
     var
     var
-      DotPos, DotPos2, i: Integer;
+      DotPos, DotPos2, i,j: Integer;
       s: String;
       s: String;
       HPackage: TPasPackage;
       HPackage: TPasPackage;
       Module: TPasModule;
       Module: TPasModule;
+
     begin
     begin
       // Find or create package
       // Find or create package
       DotPos := Pos('.', AName);
       DotPos := Pos('.', AName);
@@ -681,12 +682,13 @@ var
         HPackage.Modules.Add(Module);
         HPackage.Modules.Add(Module);
       end;
       end;
 
 
+      s:=Copy(AName, DotPos2 + 1, length(AName)-dotpos2);
       // Create node for class
       // Create node for class
-      Result := TPasClassType.Create(Copy(AName, DotPos2 + 1, Length(AName)),
-        Module.InterfaceSection);
+      Result := TPasClassType.Create(s, Module.InterfaceSection);
       Result.ObjKind := okClass;
       Result.ObjKind := okClass;
       Module.InterfaceSection.Declarations.Add(Result);
       Module.InterfaceSection.Declarations.Add(Result);
       Module.InterfaceSection.Classes.Add(Result);
       Module.InterfaceSection.Classes.Add(Result);
+      // process inheritancestr here.
     end;
     end;
 
 
   var
   var
@@ -705,7 +707,7 @@ var
       begin
       begin
         // New class
         // New class
         i := Pos(' ', s);
         i := Pos(' ', s);
-        CurClass := CreateClass(Copy(s, 1, i - 1));
+        CurClass := CreateClass(Copy(s, 1, i - 1), copy(s,i+1,length(s)));
       end else
       end else
       begin
       begin
         i := Pos(' ', s);
         i := Pos(' ', s);
@@ -820,9 +822,15 @@ begin
         ClassDecl := TPasClassType(Module.InterfaceSection.Classes[j]);
         ClassDecl := TPasClassType(Module.InterfaceSection.Classes[j]);
         Write(ContentFile, ClassDecl.PathName, ' ');
         Write(ContentFile, ClassDecl.PathName, ' ');
         if Assigned(ClassDecl.AncestorType) then
         if Assigned(ClassDecl.AncestorType) then
-          WriteLn(ContentFile, ClassDecl.AncestorType.PathName)
+          Write(ContentFile, ClassDecl.AncestorType.PathName)
         else if ClassDecl.ObjKind = okClass then
         else if ClassDecl.ObjKind = okClass then
-          WriteLn(ContentFile, '.TObject');
+          Write(ContentFile, '.TObject');
+        if ClassDecl.Interfaces.Count>0 then
+          begin
+            for k:=0 to ClassDecl.Interfaces.count-1 do
+              write(contentfile,',',TPasClassType(ClassDecl.Interfaces[k]).PathName);
+          end;
+        writeln(contentfile);
         for k := 0 to ClassDecl.Members.Count - 1 do
         for k := 0 to ClassDecl.Members.Count - 1 do
         begin
         begin
           Member := TPasElement(ClassDecl.Members[k]);
           Member := TPasElement(ClassDecl.Members[k]);