File: ok_nested_types.pas

package info (click to toggle)
pasdoc 0.16.0-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 33,572 kB
  • sloc: pascal: 28,894; javascript: 7,665; xml: 2,597; makefile: 523; sh: 417
file content (126 lines) | stat: -rw-r--r-- 3,405 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
{ @abstract(Test case for Delphi nested types)
  @author(Arno Garrels <first name.name@nospamgmx.de>)

  @HTML(<a href="http://docwiki.embarcadero.com/RADStudio/en/Nested_Type_Declarations">
     http://docwiki.embarcadero.com/RADStudio/en/Nested_Type_Declarations</a><br>
     <a href="http://wiki.freepascal.org/class_extensions_examples">
     http://wiki.freepascal.org/class_extensions_examples</a><br><br>) }

unit ok_nested_types;

interface

type
  { @abstract(@name contains nested classes, records, types and constants.) }
  TOuterClass = class(TObject)
  private
    { Description of @name }
    FOuterPrivateField: Integer;
    type
      { @abstract(@name contains one nested class, type and constant.) }
      TInnerPrivateClass = class(TObject)
      public
        type
          { Description of @name }
          TInnerPublicInteger = type Integer;
          { @abstract(Description of @name) }
          TInnerInnerPublicClass = class(TObject)
          private
            { Description of @name }
            FInnerInnerPrivateField: string;
            { Description of @name }
            function InnerInnerPrivateFunc(AValue: Integer): string;
          public
            { Description of @name }
            property InnerInnerPublicProp: string read  FInnerInnerPrivateField
                                                  write FInnerInnerPrivateField;
          end;
      private
        const
          { Description of @name }
          InnerPrivateConst = 1;
        var
          { Description of @name }
          FInnerPrivateField: Integer;
          { Description of @name }
          class procedure InnerPrivateClassProc(const AValue: Integer); static;
      public
        { Description of @name }
        FInnerPublicField: Integer;
        { Description of @name }
        procedure InnerPublicProc;
      end;
      { Description of @name }
      TOuterPrivateInteger = Integer;
      { @abstract(Description of @name) }
      TInnerPrivateClassDescendant = class(TInnerPrivateClass)
      private
        FField: Integer;
      end;
  public
    const
      { Description of @name } 
      OuterConst1 = 'Blah1';
      { Description of @name }
      OuterConst2 = 'Blah2';
    { Description of @name }
    procedure OuterPublicProc;
    type
      { @name is a nested record }
      TInnerImplicitRecord = record
      public
        { Description of @name }  
        FInnerPublicRecField: Integer;
        { Description of @name } 
        procedure InnerPublicRecProc;
      end;  
  end;
  
const
  { Description of @name }
  GlobalConst = 123456;

implementation

{ TOuterClass }

// Override comment above so that "parse implementation section" mode wouldn't change a thing
{ }

procedure TOuterClass.OuterPublicProc;
begin

end;

{ TOuterClass.TInnerPrivateClass }

class procedure TOuterClass.TInnerPrivateClass.InnerPrivateClassProc(
  const AValue: Integer);
begin

end;

procedure TOuterClass.TInnerPrivateClass.InnerPublicProc;
begin

end;

{ TOuterClass.TInnerPrivateClass.TInnerInnerPublicClass }

function TOuterClass.TInnerPrivateClass.TInnerInnerPublicClass.InnerInnerPrivateFunc(
  AValue: Integer): string;
begin

end;

{ TOuterClass.TInnerImplicitRecord }

// Override comment above so that "parse implementation section" mode wouldn't change a thing
{ }

procedure TOuterClass.TInnerImplicitRecord.InnerPublicRecProc;
begin

end;

end.