Pascal Doc

Source: test1.pas

Unit Dependencies

Interface Uses

Source Code

1(**!
2 * @mainpage Mein Projekt
3 *
4 * Willkommen in der Dokumentation.
5 *
6 * @section Übersicht
7 * Diese Engine erzeugt Pascal-Dokumentation.
8 *
9 * @subsection Features
10 * Klassen, Interfaces, Records und Typverlinkungen.
11 *
12 * @subsubsection Details
13 * Später kommen Graphviz, Call-Graphs und Unit-Dependencies dazu.
14 *)
15
16(**!
17 * @defgroup IntVariables Das sind die Integer Variablen
18 * @{
19 *)
20
21(**!
22 * Text innerhalb der Gruppe.
23 *)
24
25(**!
26 * @class VirtualClass
27 * @brief eine virtuelle Klasse
28 *)
29
30(**!
31 * @defgroup IntS Das sind die Integer Variable S
32 * @{
33 *)
34
35(**!
36 * Text der Untergruppe.
37 *)
38
39(**!
40 * @}
41 *)
42
43(**!
44 * @}
45 *)
46unit TestUnit;
47
48interface
49
50uses
51 Objects (**! @brief Base classes of all others *),
52 SysUtils (**! @brief System Utils function's *),
53 Classes (**! @brief Pascal Class'es *),
54 Dialogs;
55
56const
57 (**!
58 * @brief Maximale Anzahl.
59 *
60 * Dieser Wert begrenzt die Verarbeitung.
61 *)
62 MAX_COUNT = 100;
63
64const
65 PI_VALUE = 3.1415 ; (**! @brief This is the documentation for the PI const *)
66 APP_NAME = 'MyApp'; (**! @brief This is the application name *)
67 APP_VERSION = $1001 ; (**! @brief This is the Version *)
68
69var
70 (**! @brief Player values *)
71 score_board : Integer; (**! @brief point score board *)
72 score_text : string; (**! @brief player name text *)
73
74 (**! @brief Window values *)
75 main_width : Integer;
76 main_height : Integer;
77
78type
79 (**!
80 * @brief Beispiel-Record.
81 * @details Dieser Record speichert X- und Y-Werte.
82 *)
83 TPoint = record
84 X: Integer;
85 (**!
86 * @brief give the X position
87 * @details blah blah about X pos field
88 *)
89 Y: Integer; (**! @brief give the Y position *)
90 end;
91
92 TIntArray = array[0..10] of Integer; (**! @brief this is a integer array 0 .. 10 *)
93 TCharSet = set of Char; (**! @brief a char set *)
94
95type
96 TCard = (One, Two, Three); (**! @brief available cards *)
97
98type
99 TColor = (
100 Red, (**! @brief red color *)
101 Green, (**! @brief green color *)
102 Blue (**! @brief blue color *)
103 ); (**! @brief available colors *)
104
105type
106 (**!
107 * @brief Basisklasse.
108 *
109 * Dies ist die ausführliche Beschreibung der Basisklasse.
110 *)
111 TBaseClass = class
112 public
113 procedure BaseMethod;
114 end;
115
116 (**! @brief Abgeleitete Klasse *)
117 TChildClass = class(TBaseClass)
118 public
119 procedure ChildMethod;
120 end;
121
122type
123 (**!
124 * @brief Beispiel-Interface.
125 * @details Dies ist eine längere Beschreibung
126 * für das Interface.
127 *)
128 IExample = interface
129 procedure Execute;
130 end;
131
132 (**!
133 * @brief Beispielklasse.
134 *
135 * Diese Klasse zeigt @brief und automatische Details.
136 *)
138 public
139 (**!
140 * @brief Führt die Aktion aus.
141 *
142 * Diese Methode implementiert die Interface-Methode.
143 *)
144 procedure Execute;
145 end;
146
147type
148 (**! @brief Basis-Interface für zeichnbare Objekte *)
149 IDrawable = interface
150 (**! @brief Zeichnet das Objekt *)
151 procedure Draw;
152
153 (**! @brief Sichtbarkeit des Objekts *)
154 property Visible: Boolean
155 read FVisible (**! @brief Liefert den Sichtbarkeitsstatus *)
156 write FVisible (**! @brief Setzt den Sichtbarkeitsstatus *);
157 end;
158
159 (**! @brief Interface für geometrische Formen *)
160 IShape = interface(IDrawable)
161 (**! @brief Berechnet die Fläche *)
162 function Area: Double;
163
164 (**! @brief Name der Form *)
165 property Name: string
166 read FName (**! @brief Liefert den Namen *)
167 write FName (**! @brief Setzt den Namen *);
168 end;
169
170 (**! @brief Generisches Listen-Interface *)
171 IList<T> = interface
172 (**! @brief Fügt ein Element hinzu *)
173 procedure Add(Item: T);
174
175 (**! @brief Liefert ein Element anhand des Index *)
176 function GetItem(Index: Integer): T;
177
178 (**! @brief Anzahl der Elemente *)
179 property Count: Integer read FCount (**! @brief Liefert die Anzahl *);
180 end;
181
182type
183 (**! @brief Sprite class implementing IDrawable *)
184 TSprite = class(TObject, IDrawable)
185 public
186 procedure Draw;
187 end;
188
189type
190 TWeapon = class
191 end;
192
193 TInventory = class
194 end;
195
196 IRenderable = interface
197 procedure Render;
198 end;
199
201 private
204 public
205 procedure Equip(AWeapon: TWeapon);
206 procedure Render;
207 end;
208
209type
210 (**!
211 * @brief This is the TPerson class
212 *)
213 TPerson = class(TObject)
214 private
215 FName: string;
216 FAge: Integer;
217 protected
218 procedure Paint;
219 public
220 (**!
221 * @brief Erzeugt ein neues Objekt
222 * @details This is the default constructor.
223 *)
224 constructor Create; overload;
225 (**!
226 * @brief Erzeugt ein neues Objekt mit einen string.
227 * @details This is the constructor with a string.
228 *)
229 constructor Create(S1: String); overload;
230 constructor Create(P1: TPoint); overload;
231 destructor Destroy; override;
232 (**!
233 * @brief Speichert die aktuellen Daten
234 *
235 * @param S1 string 1
236 * @param S2 string 2
237 *
238 * @note Wird intern gecached.
239 * @info Diese Methode ist thread-safe.
240 * @warn X und Y dürfen nicht negativ sein.
241 *)
242 procedure Save(S1: string; S2: string); virtual;
243 procedure Point(A: TPoint; B: TPoint);
244 (**!
245 * @brief Get the name of the class
246 * @return string - Ein String als Rückgabe
247 *)
248 function GetName: string;
249 property Name: string (**! @brief Datentyp *)
250 read FName (**! @brief getter of Name *)
251 write FName (**! @brief setter of Name *);
252 end;
253
254type
255 (**! @brief Generic list interface *)
256 IList<T> = interface
257 (**! @brief Add one item to the list *)
258 procedure Add(Item: T);
259
260 (**! @brief Get item by index *)
261 function GetItem(Index: Integer): T;
262
263 property Count: Integer (**! @brief number datatype *)
264 read GetCount (**! @brief returns item count *);
265 end;
266
267 (**! @brief Generic key value pair record *)
268 TPair<TKey, TValue> = record
269 Key : TKey; (**! @brief key value *)
270 Value : TValue; (**! @brief stored value *)
271 end;
272
273 (**! @brief Generic repository class *)
274 TRepository<T> = class
275 private
276 FItems: IList<T>;
277
278 public
279 (**! @brief Add entity *)
280 procedure Add(Entity: T);
281
282 (**! @brief Find entity by id *)
283 function FindById(Id: Integer): T;
284
285 property Items: IList<T> (**! @brief list datatype *)
286 read FItems (**! @brief returns internal list *);
287 end;
288
289(**!
290 * @class TVirtualClass
291 * @brief Virtuelle Klasse
292 * @details Diese Klasse existiert nur in der Dokumentation.
293 *
294 * A list of events:
295 * - mouse events
296 * -# mouse move event
297 * -# mouse click event\n
298 * More info about the click event.
299 * -# mouse double click event
300 * - keyboard events
301 * 1. key down event
302 * 2. key up event
303 * - checkbox list
304 * - [ ] unchecked
305 * - [x] checked
306 *
307 * More text here.
308 *
309 *
310 * | Name | Type | Description |
311 * |------|------|-------------|
312 * | X | Integer | Position X |
313 * | Y | Integer | Position Y |
314 *
315 * @code
316 * procedure Test;
317 * begin
318 * WriteLn('Hallo');
319 * end;
320 * @endcode
321 *)
322
323(**!
324 * @interface IVirtualInterface
325 * @brief Virtuelles Interface
326 *)
327
328(**!
329 * @record TVirtualRecord
330 * @brief Virtueller Record
331 *)
332
333(**!
334 * @enum TVirtualEnum
335 * @brief Virtuelles Enum
336 * @details
337 *
338 * :icon-info: Das ist eine Information.
339 * :icon-alert: Das ist eine Warnung.
340 *
341 * @icon check Erfolgreich abgeschlossen.
342 * @icon bug Bekannter Fehler.
343 *)
344
345implementation
346
347uses
348 Windows (**! @brief Windows XP System stuff *),
349 VCL (**! @brief Visual Control Library *),
350 Forms (**! @brief Window Forms stuff *);
351
352procedure TExampleClass.Execute;
353begin
354end;
355
356end.