|
1
|
|
|
2
|
|
|
3
|
### ### #### # ####
|
|
4
|
# # # # # # ### # ### # # # ### ####
|
|
5
|
# # # # #### # # ## # # # # # # #
|
|
6
|
# # # # # # ## # # # # # # #
|
|
7
|
### ### # #### # # ### ### ####
|
|
8
|
|
|
9
|
|
|
10
|
http://www.shredzone.net/go/ooperldoc
|
|
11
|
|
|
12
|
|
|
13
|
|
|
14
|
1. OOPerlDoc
|
|
15
|
-----------------------------------------------------
|
|
16
|
OOPerlDoc is a tool that has been designed to create a good-looking
|
|
17
|
HTML documentation out of Perl programs. It was focussed on object
|
|
18
|
oriented Perl programming, but it is usable for procedural Perl
|
|
19
|
modules as well.
|
|
20
|
|
|
21
|
The resulting HTML document consists of several HTML files which are
|
|
22
|
linked to each other. You can see them with every HTML 3.2 compliant
|
|
23
|
web browser that supports frames.
|
|
24
|
|
|
25
|
|
|
26
|
1.1. Invocation
|
|
27
|
-----------------------------------------------------
|
|
28
|
OOPerlDoc is invoked from the shell, like this:
|
|
29
|
|
|
30
|
ooperldoc [options] [dir1 [dir2 [..]]]
|
|
31
|
|
|
32
|
Options are:
|
|
33
|
|
|
34
|
-h --help Show short help summary, and exit.
|
|
35
|
|
|
36
|
-D [dir] --dir [dir] Select the output directory where the
|
|
37
|
HTML files are put into. The current
|
|
38
|
directory will be used if this
|
|
39
|
parameter is omitted.
|
|
40
|
|
|
41
|
-s --source Add sourcecode to documentation. The
|
|
42
|
source files will be syntax highlighted
|
|
43
|
(in a simple way), put into a "src"
|
|
44
|
directory within the output directory,
|
|
45
|
and referenced by the class and method
|
|
46
|
documentation. This will take some more
|
|
47
|
time, and blow up the documentation a
|
|
48
|
big deal. Some people also do not want
|
|
49
|
to make their source public. Thus, this
|
|
50
|
option is turned off by default.
|
|
51
|
|
|
52
|
-v --verbose Verbose output of what OOPerlDoc is
|
|
53
|
currently doing.
|
|
54
|
|
|
55
|
-O --overwrite Force OOPerlDoc to overwrite its
|
|
56
|
stylesheet file style.css. By default,
|
|
57
|
the stylesheet file is kept when it is
|
|
58
|
found, in case it was customized.
|
|
59
|
|
|
60
|
-p --private The documentation will also contain
|
|
61
|
all methods which were declared as
|
|
62
|
"private". If omitted, private methods
|
|
63
|
will be ignored.
|
|
64
|
|
|
65
|
-t [title] --title [title] The document's title as it will be
|
|
66
|
shown in the browser's title bar.
|
|
67
|
|
|
68
|
--temp Convert temporary files as well. This
|
|
69
|
are all files having a period '.' as
|
|
70
|
the first file name letter, or a tilde
|
|
71
|
'~' as its last letter. If omitted,
|
|
72
|
temporary files and directories will
|
|
73
|
be ignored.
|
|
74
|
|
|
75
|
After the options, a list of one or more directories is following.
|
|
76
|
These directories are scanned recursively (temporary files will be
|
|
77
|
ignored, see '--temp' option above), and every readable file is parsed
|
|
78
|
for OOPerlDoc comments.
|
|
79
|
|
|
80
|
If the list of directories is omitted, all files starting from the
|
|
81
|
current directory, will be scanned.
|
|
82
|
|
|
83
|
OOPerlDoc parses every readable file in the given directory tree(s).
|
|
84
|
After that, it generates a documentation file for each valid class
|
|
85
|
file it has found.
|
|
86
|
|
|
87
|
|
|
88
|
2. Rules for valid OOPerlDoc comments
|
|
89
|
-----------------------------------------------------
|
|
90
|
|
|
91
|
OOPerlDoc is only parsing through a file for special comment blocks.
|
|
92
|
Lines of Perl code will be ignored. Thus, OOPerlDoc is also suited for
|
|
93
|
uncomplete programs, as well as for other programming languages which
|
|
94
|
are using Perl style comments (as e.g. shell scripts). It is not
|
|
95
|
limited to compileable Perl code.
|
|
96
|
|
|
97
|
The source code is divided into one or more comment blocks, which are
|
|
98
|
again divided into one or more sections.
|
|
99
|
|
|
100
|
|
|
101
|
2.1. Comment blocks
|
|
102
|
-----------------------------------------------------
|
|
103
|
|
|
104
|
A comment block always starts with a double hash '##'. After that,
|
|
105
|
only zero or more whitespaces, dashes '-' and equal signs '=' are
|
|
106
|
allowed.
|
|
107
|
|
|
108
|
The block extends over all subsequent lines which are starting with a
|
|
109
|
single hash '#'. A block ends if no hash '#' is found in a line, or if
|
|
110
|
there were leadinging non-whitespace characters.
|
|
111
|
|
|
112
|
There must be at least one non-commented line (e.g. an empty line)
|
|
113
|
between two comment blocks for now. This may change in a future
|
|
114
|
release.
|
|
115
|
|
|
116
|
You may indent the comment blocks with spaces and tabs.
|
|
117
|
|
|
118
|
To improve the look of a comment, you can always add comment lines
|
|
119
|
which entirely consist of whitespace, dashes '-' and equal signs '='
|
|
120
|
after the hash '#'. Those lines will be ignored by OOPerlDoc.
|
|
121
|
|
|
122
|
Examples will follow below.
|
|
123
|
|
|
124
|
|
|
125
|
2.2. Sections
|
|
126
|
-----------------------------------------------------
|
|
127
|
|
|
128
|
A comment block is divided into one or more sections.
|
|
129
|
|
|
130
|
A section is started by a certain section name. All subsequent lines
|
|
131
|
then refer to this section, until the comment block ends, or a new
|
|
132
|
section is opened.
|
|
133
|
|
|
134
|
A section name is always written in capital letters only. After that,
|
|
135
|
a colon may follow. The rest of the line must only contain
|
|
136
|
whitespaces.
|
|
137
|
|
|
138
|
Sections may be interrupted by other sections, and resumed later
|
|
139
|
within the same comment block, by using the section name again. Anyhow
|
|
140
|
we strongly discourage you to use this.
|
|
141
|
|
|
142
|
|
|
143
|
2.3. Content of a section
|
|
144
|
-----------------------------------------------------
|
|
145
|
|
|
146
|
After a section name, the content of the section is following.
|
|
147
|
|
|
148
|
The formatting of the content depends on the section name.
|
|
149
|
|
|
150
|
In some sections, it is allowed (and you are encouraged) to use HTML
|
|
151
|
markup. Anyhow you should limit yourself to very simple HTML 3.2,
|
|
152
|
without browser dependent code.
|
|
153
|
|
|
154
|
<img> tags are only allowed if the image source is an absolute URL
|
|
155
|
referring to a server. It should be rarely used though.
|
|
156
|
|
|
157
|
OOPerlDoc will remove all whitespaces following a hash '#'. This can
|
|
158
|
lead to problems in preformatted environments, as <pre> containers.
|
|
159
|
So, to avoid whitespace stripping, you can put a dash '|' at the
|
|
160
|
position where whitespaces should be taken to the final documentation.
|
|
161
|
All whitespace before the dash, and the dash itself, will be stripped.
|
|
162
|
|
|
163
|
Example:
|
|
164
|
|
|
165
|
# EXAMPLE:
|
|
166
|
# <pre>
|
|
167
|
# if(a == b) {
|
|
168
|
# print "A gleich B\n";
|
|
169
|
# a = 0;
|
|
170
|
# }
|
|
171
|
# </pre>
|
|
172
|
|
|
173
|
will result in
|
|
174
|
|
|
175
|
if(a == b) {
|
|
176
|
print "A gleich B\n";
|
|
177
|
a = 0;
|
|
178
|
}
|
|
179
|
|
|
180
|
in the documentation, because all whitespace were stripped. Now use
|
|
181
|
dashes like this:
|
|
182
|
|
|
183
|
# EXAMPLE:
|
|
184
|
# <pre>
|
|
185
|
# | if(a == b) {
|
|
186
|
# | print "A gleich B\n";
|
|
187
|
# | a = 0;
|
|
188
|
# | }
|
|
189
|
# </pre>
|
|
190
|
|
|
191
|
to get the result you have expected:c
|
|
192
|
|
|
193
|
if(a == b) {
|
|
194
|
print "A gleich B\n";
|
|
195
|
a = 0;
|
|
196
|
}
|
|
197
|
|
|
198
|
IMPORTANT: since HTML markup is used, remember to replace all smaller
|
|
199
|
signs '<' and ampersand '&' in your program code by the appropriate
|
|
200
|
HTML entities.
|
|
201
|
|
|
202
|
OOPerlDoc cares about some formatting for you.
|
|
203
|
|
|
204
|
First, the keyword "undef" will automatically placed within a <code>
|
|
205
|
container and is rendered in a fixed width font in the documentation.
|
|
206
|
|
|
207
|
Hyperlinks starting with "http", "https" and "ftp", are converted into
|
|
208
|
real links.
|
|
209
|
|
|
210
|
Finally, if you use a class name that is known to OOPerlDoc (because
|
|
211
|
that class will be converted within the same OOPerlDoc invocation), it
|
|
212
|
will automatically place a link onto this class.
|
|
213
|
|
|
214
|
|
|
215
|
3. Comment types
|
|
216
|
-----------------------------------------------------
|
|
217
|
|
|
218
|
The Perl source contains several comment types.
|
|
219
|
|
|
220
|
|
|
221
|
3.1. Class comments
|
|
222
|
-----------------------------------------------------
|
|
223
|
|
|
224
|
This comment type describes the entire class file itself. It must be
|
|
225
|
present in order to let OOPerlDoc convert this class. It is strongly
|
|
226
|
suggested to place this comment at the topmost position of the file.
|
|
227
|
|
|
228
|
These sections can be used in a class comment (a detailed description
|
|
229
|
will follow below):
|
|
230
|
|
|
231
|
CLASS The name of the class. Required!
|
|
232
|
|
|
233
|
NAME Used instead of CLASS, but for procedural modules.
|
|
234
|
|
|
235
|
EXTENDS List of super classes this class is derived from.
|
|
236
|
Note that even though you can list more than one
|
|
237
|
superclass here, OOPerlDoc does not support multiple
|
|
238
|
inheritance yet.
|
|
239
|
|
|
240
|
PURPOSE The purpose of this class. Required!
|
|
241
|
|
|
242
|
NOTE Important note about this class. This note will be
|
|
243
|
shown separately, with a "Note:" written before,
|
|
244
|
so it will easily be seen.
|
|
245
|
|
|
246
|
REQUIRES Other modules, classes and programs this class
|
|
247
|
depends on.
|
|
248
|
|
|
249
|
DEPRECATED If the class has been deprecated, use this section.
|
|
250
|
State the reason of deprecation and show a possible
|
|
251
|
replacement here.
|
|
252
|
|
|
253
|
AUTHOR Author(s) of this class.
|
|
254
|
|
|
255
|
VERSION Version and date.
|
|
256
|
|
|
257
|
CVS Reserved for CVS version ID.
|
|
258
|
|
|
259
|
HISTORY Change history of this class.
|
|
260
|
|
|
261
|
SEE Cross references to other classes and further
|
|
262
|
information about the topic.
|
|
263
|
|
|
264
|
COPYRIGHT Copyright note.
|
|
265
|
|
|
266
|
SINCE Version of the software where this class has been
|
|
267
|
introduced. This is important for backward
|
|
268
|
compatibility.
|
|
269
|
|
|
270
|
This is an example of a valid class comment:
|
|
271
|
|
|
272
|
##------------------------------------------------------
|
|
273
|
# CLASS:
|
|
274
|
# static: Examples::CL_Example
|
|
275
|
# EXTENDS:
|
|
276
|
# Examples::CL_Super
|
|
277
|
#
|
|
278
|
# PURPOSE:
|
|
279
|
# This class is just an <b>example</b>.
|
|
280
|
#
|
|
281
|
# NOTE:
|
|
282
|
# This class is not yet completed, so use it with care.
|
|
283
|
#
|
|
284
|
# REQUIRES:
|
|
285
|
# data::dumper
|
|
286
|
#
|
|
287
|
# AUTHOR:
|
|
288
|
# Richard K?rber <dev@shredzone.de>
|
|
289
|
#
|
|
290
|
# VERSION:
|
|
291
|
# V1.0 (2000-08-22)
|
|
292
|
#-------------------------------------------------------
|
|
293
|
# HISTORY:
|
|
294
|
# V1.0 (2000-08-22) rkoerber
|
|
295
|
# - First release of this class
|
|
296
|
#-------------------------------------------------------
|
|
297
|
|
|
298
|
|
|
299
|
|
|
300
|
3.1.1. CLASS
|
|
301
|
-----------------------------------------------------
|
|
302
|
|
|
303
|
SECTION: CLASS
|
|
304
|
|
|
305
|
CONTEXT: class comment (REQUIRED SECTION)
|
|
306
|
|
|
307
|
PURPOSE:
|
|
308
|
This section introduces a class comment, by describing the class
|
|
309
|
name. If the Perl module is not a class, but a procedural module,
|
|
310
|
you should use NAME instead of class (see 3.1.2).
|
|
311
|
|
|
312
|
CONTENT:
|
|
313
|
The section only contains the class name, which is optionally
|
|
314
|
preceeded by modifiers. The list of modifiers is separated by
|
|
315
|
space and terminated by a colon.
|
|
316
|
|
|
317
|
[modifier [' ' modifier ...] ': '] class_name
|
|
318
|
|
|
319
|
If no modifieres are given, you may leave out the colon.
|
|
320
|
|
|
321
|
You are not allowed to add further text.
|
|
322
|
|
|
323
|
These modifiers are allowed:
|
|
324
|
|
|
325
|
static Static class, cannot be instantiated.
|
|
326
|
|
|
327
|
abstract This class contains at least one abstract method.
|
|
328
|
Only its derivates can be instantiated.
|
|
329
|
|
|
330
|
final This class is finished and must not be derivated.
|
|
331
|
|
|
332
|
deprecated This class is entirely obsoleted. It may be removed
|
|
333
|
in future releases, and must not be used in new
|
|
334
|
code.
|
|
335
|
|
|
336
|
EXAMPLE:
|
|
337
|
|
|
338
|
:
|
|
339
|
# CLASS
|
|
340
|
# Package::FooClass
|
|
341
|
:
|
|
342
|
|
|
343
|
:
|
|
344
|
# CLASS
|
|
345
|
# static final: Package::FinalClass
|
|
346
|
:
|
|
347
|
|
|
348
|
|
|
349
|
|
|
350
|
3.1.2. NAME
|
|
351
|
-----------------------------------------------------
|
|
352
|
|
|
353
|
SECTION: NAME
|
|
354
|
|
|
355
|
CONTEXT: class comment (REQUIRED SECTION)
|
|
356
|
|
|
357
|
PURPOSE:
|
|
358
|
If this module describes a procedural program rather than an OOP
|
|
359
|
class, you should use "NAME" instead of "CLASS" (see 3.1.1.).
|
|
360
|
|
|
361
|
CONTENT:
|
|
362
|
See 3.1.1. "CLASS".
|
|
363
|
|
|
364
|
Only the "deprecated" modifier may be used here. Other modifiers are
|
|
365
|
for OOP purposes only, and not of relevance in procedural
|
|
366
|
programming.
|
|
367
|
|
|
368
|
If you use "NAME" instead of "CLASS", you should also use "FUNCTION"
|
|
369
|
instead of "METHOD".
|
|
370
|
|
|
371
|
EXAMPLE:
|
|
372
|
|
|
373
|
:
|
|
374
|
# NAME
|
|
375
|
# Package::FooModule
|
|
376
|
:
|
|
377
|
|
|
378
|
:
|
|
379
|
# NAME
|
|
380
|
# deprecated: Package::DeprecatedModule
|
|
381
|
:
|
|
382
|
|
|
383
|
|
|
384
|
|
|
385
|
3.1.3. EXTENDS
|
|
386
|
-----------------------------------------------------
|
|
387
|
|
|
388
|
SECTION: EXTENDS
|
|
389
|
|
|
390
|
CONTEXT: class comment
|
|
391
|
|
|
392
|
PURPOSE:
|
|
393
|
Used in a class comment, to list all super classes this class is
|
|
394
|
derived from. If this section is omitted, the class will implicitly
|
|
395
|
be derived from UNIVERSAL.
|
|
396
|
|
|
397
|
CONTENT:
|
|
398
|
A list of the names of all super classes. The names are separated by
|
|
399
|
comma or line breaks. Other text and HTML markup is not allowed.
|
|
400
|
|
|
401
|
OOPerlDoc does not support multiple inheritance yet. Thus, if you
|
|
402
|
give a list of names, only the first name will be used for
|
|
403
|
generating a class tree. The following names are just listed in the
|
|
404
|
class description.
|
|
405
|
|
|
406
|
NOTE:
|
|
407
|
This section is required because OOPerlDoc will not evaluate the
|
|
408
|
@ISA list.
|
|
409
|
|
|
410
|
EXAMPLE:
|
|
411
|
|
|
412
|
:
|
|
413
|
# EXTENDS:
|
|
414
|
# MyClass::MySuperClass
|
|
415
|
:
|
|
416
|
|
|
417
|
:
|
|
418
|
# EXTENDS:
|
|
419
|
# MyClass::MySuperClass, MyClass::SecondClass
|
|
420
|
# HelpPackage::UniversalHelp
|
|
421
|
:
|
|
422
|
|
|
423
|
|
|
424
|
|
|
425
|
3.1.4. PURPOSE
|
|
426
|
-----------------------------------------------------
|
|
427
|
|
|
428
|
SECTION: PURPOSE
|
|
429
|
|
|
430
|
CONTEXT: class comment (REQUIRED SECTION)
|
|
431
|
|
|
432
|
PURPOSE:
|
|
433
|
Describe the purpose of the class or module.
|
|
434
|
|
|
435
|
CONTENT:
|
|
436
|
A plain text of your choice. The first sentence should always
|
|
437
|
describe a short summary of the purpose of this class. The next
|
|
438
|
sentences will then describe more details.
|
|
439
|
|
|
440
|
You are allowed (and encouraged) to use HTML markup here.
|
|
441
|
|
|
442
|
EXAMPLE:
|
|
443
|
|
|
444
|
:
|
|
445
|
# PURPOSE:
|
|
446
|
# A demonstration class. This text demonstrates how
|
|
447
|
# to use the <code>PURPOSE</code> section in a class
|
|
448
|
# comment.
|
|
449
|
:
|
|
450
|
|
|
451
|
|
|
452
|
|
|
453
|
3.1.5. NOTE
|
|
454
|
-----------------------------------------------------
|
|
455
|
|
|
456
|
SECTION: NOTE
|
|
457
|
|
|
458
|
CONTEXT: class comment
|
|
459
|
|
|
460
|
PURPOSE:
|
|
461
|
Important note about this class. Optional. The purpose is to
|
|
462
|
the user very important information about how to use this class
|
|
463
|
and avoid bugs.
|
|
464
|
|
|
465
|
CONTENT:
|
|
466
|
This is plain text. HTML markup is allowed. Known class names will
|
|
467
|
be linked to the appropriate documentation automatically.
|
|
468
|
|
|
469
|
EXAMPLE:
|
|
470
|
|
|
471
|
:
|
|
472
|
# NOTE:
|
|
473
|
# This class is often mixed up with ExampleClass2.
|
|
474
|
:
|
|
475
|
|
|
476
|
|
|
477
|
|
|
478
|
3.1.6. REQUIRES
|
|
479
|
-----------------------------------------------------
|
|
480
|
|
|
481
|
SECTION: REQUIRES
|
|
482
|
|
|
483
|
CONTEXT: class comment
|
|
484
|
|
|
485
|
PURPOSE:
|
|
486
|
A list of things this class requires to run properly. This can be
|
|
487
|
other classes, installed Perl packages, third party software etc.
|
|
488
|
|
|
489
|
CONTENT:
|
|
490
|
There is no special format defined for this section. You may use
|
|
491
|
HTML markup. Known class names will be linked automatically.
|
|
492
|
|
|
493
|
EXAMPLE:
|
|
494
|
|
|
495
|
:
|
|
496
|
# REQUIRES:
|
|
497
|
# <a href="http://www.imagemagick.org">ImageMagick</a>
|
|
498
|
:
|
|
499
|
|
|
500
|
|
|
501
|
3.1.7. DEPRECATED
|
|
502
|
-----------------------------------------------------
|
|
503
|
|
|
504
|
SECTION: DEPRECATED
|
|
505
|
|
|
506
|
CONTEXT: class comment
|
|
507
|
|
|
508
|
PURPOSE:
|
|
509
|
Contains further details about the deprecation.
|
|
510
|
|
|
511
|
CONTENT:
|
|
512
|
If you have marked a class as deprecated (by the deprecated
|
|
513
|
modifier, see 3.1.1. and 3.1.2.), you are encouraged to write in
|
|
514
|
this section:
|
|
515
|
|
|
516
|
* Why has the class been deprecated?
|
|
517
|
* How can the functionality be replaced? (i.e. is there a new
|
|
518
|
class that replaces this class?)
|
|
519
|
|
|
520
|
EXAMPLE:
|
|
521
|
|
|
522
|
:
|
|
523
|
# DEPRECATED:
|
|
524
|
# This class has been replaced by ReplacerClass. Do not
|
|
525
|
# use this class in new code.
|
|
526
|
:
|
|
527
|
|
|
528
|
|
|
529
|
|
|
530
|
3.1.8. VERSION
|
|
531
|
-----------------------------------------------------
|
|
532
|
|
|
533
|
SECTION: VERSION
|
|
534
|
|
|
535
|
CONTEXT: class comment
|
|
536
|
|
|
537
|
PURPOSE:
|
|
538
|
Describes the current version and release date of this class.
|
|
539
|
|
|
540
|
CONTENT:
|
|
541
|
The syntax is:
|
|
542
|
|
|
543
|
('V'|'v') nr ['.' nr [...]] ['(' year '-' month '-' day ')']
|
|
544
|
|
|
545
|
This section starts with either a capital or small 'V', followed by
|
|
546
|
a version number (with subversions divided by a period). Optionally,
|
|
547
|
a date may follow within brackets. The format is YYYY-MM-DD.
|
|
548
|
|
|
549
|
EXAMPLE:
|
|
550
|
|
|
551
|
:
|
|
552
|
# VERSION:
|
|
553
|
# V3.0.2 (2000-08-24)
|
|
554
|
:
|
|
555
|
|
|
556
|
|
|
557
|
3.1.9. CVS
|
|
558
|
-----------------------------------------------------
|
|
559
|
|
|
560
|
SECTION: CVS
|
|
561
|
|
|
562
|
CONTEXT: class comment
|
|
563
|
|
|
564
|
PURPOSE:
|
|
565
|
This section contains the version number that is maintained by CVS.
|
|
566
|
|
|
567
|
CONTENT:
|
|
568
|
The initial content is just 'Id' enclosed in dollar signs. It will
|
|
569
|
be updated by CVS automatically, everytime the content is committed
|
|
570
|
to the repository.
|
|
571
|
|
|
572
|
NOTE:
|
|
573
|
It is a capital 'I' and a small 'd', surrounded by dollar signs.
|
|
574
|
|
|
575
|
|
|
576
|
|
|
577
|
3.1.10. HISTORY
|
|
578
|
-----------------------------------------------------
|
|
579
|
|
|
580
|
SECTION: HISTORY
|
|
581
|
|
|
582
|
CONTEXT: class comment
|
|
583
|
|
|
584
|
PURPOSE:
|
|
585
|
History of changes made to this class.
|
|
586
|
|
|
587
|
CONTENT:
|
|
588
|
The content is not defined by OOPerlDoc. You may use HTML markup.
|
|
589
|
Known class names will be linked.
|
|
590
|
|
|
591
|
|
|
592
|
|
|
593
|
3.1.11. SEE
|
|
594
|
-----------------------------------------------------
|
|
595
|
|
|
596
|
SECTION: SEE
|
|
597
|
|
|
598
|
CONTEXT: class comment
|
|
599
|
|
|
600
|
PURPOSE:
|
|
601
|
Cross reference to other classes and further information about the
|
|
602
|
topic.
|
|
603
|
|
|
604
|
CONTENT:
|
|
605
|
A link to everything that is related to this class, as other
|
|
606
|
classes, software, literature, etc.
|
|
607
|
|
|
608
|
You may use HTML markup here. Known class names will be linked.
|
|
609
|
|
|
610
|
EXAMPLE:
|
|
611
|
|
|
612
|
:
|
|
613
|
# SEE:
|
|
614
|
# Package::OtherClass, <a href="http://www.w3.org">W3</a>
|
|
615
|
:
|
|
616
|
|
|
617
|
|
|
618
|
|
|
619
|
3.1.12. COPYRIGHT
|
|
620
|
-----------------------------------------------------
|
|
621
|
|
|
622
|
SECTION: COPYRIGHT
|
|
623
|
|
|
624
|
CONTEXT: class comment
|
|
625
|
|
|
626
|
PURPOSE:
|
|
627
|
Copyright info to this class.
|
|
628
|
|
|
629
|
CONTENT:
|
|
630
|
No special format. HTML markup is allowed.
|
|
631
|
|
|
632
|
EXAMPLE:
|
|
633
|
|
|
634
|
:
|
|
635
|
# COPYRIGHT:
|
|
636
|
# Copyright (C) 2001 dimedis GmbH, Cologne, Germany
|
|
637
|
:
|
|
638
|
|
|
639
|
|
|
640
|
|
|
641
|
3.1.13. SINCE
|
|
642
|
-----------------------------------------------------
|
|
643
|
|
|
644
|
SECTION: SINCE
|
|
645
|
|
|
646
|
CONTEXT: class comment
|
|
647
|
|
|
648
|
PURPOSE:
|
|
649
|
Version of this software, when this class has been introduced.
|
|
650
|
|
|
651
|
CONTENT:
|
|
652
|
Describes the version of the entire software package where this
|
|
653
|
class has been introduced. A programmer will know that this version
|
|
654
|
of the software package is required if he uses this class.
|
|
655
|
|
|
656
|
The format is equal to VERSION (3.1.7.), see there.
|
|
657
|
|
|
658
|
EXAMPLE:
|
|
659
|
|
|
660
|
:
|
|
661
|
# SINCE:
|
|
662
|
# V2.1.3 (2000-04-12)
|
|
663
|
:
|
|
664
|
|
|
665
|
|
|
666
|
|
|
667
|
3.2. Attributes comment
|
|
668
|
-----------------------------------------------------
|
|
669
|
|
|
670
|
This comment type lists all class attributes which are available.
|
|
671
|
|
|
672
|
Perl does not know about class attributes like other OOP related
|
|
673
|
programming languages. Instead, there usually is a hash variable that
|
|
674
|
is blessed to the package name.
|
|
675
|
|
|
676
|
The attribute comment block contains a table of all hash keys of that
|
|
677
|
hash, and their meaning.
|
|
678
|
|
|
679
|
In the documentation, the attribute comment will be shown below the
|
|
680
|
class outline.
|
|
681
|
|
|
682
|
This is an example of a valid attribute comment:
|
|
683
|
|
|
684
|
##------------------------------------------------------
|
|
685
|
# ATTRIBUTES:
|
|
686
|
# public: type => object type
|
|
687
|
# private: name => some name
|
|
688
|
# public readonly: shape => some shape instance
|
|
689
|
#-------------------------------------------------------
|
|
690
|
|
|
691
|
|
|
692
|
3.2.1. ATTRIBUTES
|
|
693
|
-----------------------------------------------------
|
|
694
|
|
|
695
|
SECTION: ATTRIBUTES
|
|
696
|
|
|
697
|
CONTEXT: attribute comment (REQUIRED SECTION)
|
|
698
|
|
|
699
|
PURPOSE:
|
|
700
|
List of all class attributes.
|
|
701
|
|
|
702
|
CONTENT:
|
|
703
|
The content consists of key-value-pairs.
|
|
704
|
|
|
705
|
The key is a valid identifier name (only letters, numbers and
|
|
706
|
underscore is allowed), which may be prefixed by modifiers. The
|
|
707
|
modifiers are separated by a colon.
|
|
708
|
|
|
709
|
After the key, the hash operator '=>' must follow. After that, the
|
|
710
|
description follows. The description may extend to the next lines.
|
|
711
|
It is stopped as soon as a new valid key is recognized.
|
|
712
|
|
|
713
|
Syntax:
|
|
714
|
|
|
715
|
[modifier [modifier ...] ':'] name '=>' description
|
|
716
|
|
|
717
|
These modifiers are allowed:
|
|
718
|
|
|
719
|
public Attribute is public (i.e. accessible by all classes)
|
|
720
|
protected Attribute is protected (i.e. accessible only by the
|
|
721
|
class itself, and its subclasses)
|
|
722
|
private Attribute is private (i.e. accessible only to the
|
|
723
|
class itself)
|
|
724
|
|
|
725
|
readonly The attribute is read only. Only the owner instance
|
|
726
|
itself is allowed to change it.
|
|
727
|
|
|
728
|
restricted The attribute access is restricted. The owner class,
|
|
729
|
and its subclasses, are allowed to change it. All
|
|
730
|
other classes only have read access.
|
|
731
|
|
|
732
|
final A constant value. The attribute is set at construction
|
|
733
|
time, and then will not change any more. Even the
|
|
734
|
owner class is not allowed to change the value.
|
|
735
|
|
|
736
|
deprecated This attribute is deprecated. It may be removed in
|
|
737
|
future releases. Do not use in new code.
|
|
738
|
|
|
739
|
The description may use HTML markup. Known class names will be
|
|
740
|
linked automatically.
|
|
741
|
|
|
742
|
|
|
743
|
|
|
744
|
3.3. General comment
|
|
745
|
-----------------------------------------------------
|
|
746
|
|
|
747
|
A general comment can be used for all kind of purposes.
|
|
748
|
|
|
749
|
The comment block output is arranged below the attribute comment
|
|
750
|
output. You can have several general comments, which are put below
|
|
751
|
each other in the sequence they are found.
|
|
752
|
|
|
753
|
A general comment always consists of a title, which will be put to the
|
|
754
|
top of the table.
|
|
755
|
|
|
756
|
Additionally, you can put plain text, a key-value table, or both.
|
|
757
|
|
|
758
|
The plain text content is put into a COMMENT section. The key-value
|
|
759
|
table is put into a HASHMAP section.
|
|
760
|
|
|
761
|
If you use both, the plain text is always shown above the key-value
|
|
762
|
table. This may change in a future release of OOPerlDoc, so you
|
|
763
|
shouldn't rely on that. You are encouraged to always use the COMMENT
|
|
764
|
section first, and the HASHMAP section after that. Never use more than
|
|
765
|
one of these sections in each general comment, for now.
|
|
766
|
|
|
767
|
Example:
|
|
768
|
|
|
769
|
##------------------------------------------------------
|
|
770
|
# EXTRA
|
|
771
|
# Keys
|
|
772
|
#
|
|
773
|
# COMMENT
|
|
774
|
# List of all keys that can be passed to the
|
|
775
|
# <code>get_key</code> method.
|
|
776
|
#
|
|
777
|
# HASHMAP
|
|
778
|
# name => First and family name
|
|
779
|
# street => Street and number
|
|
780
|
# town => ZIP and town
|
|
781
|
#-------------------------------------------------------
|
|
782
|
|
|
783
|
|
|
784
|
|
|
785
|
|
|
786
|
|
|
787
|
3.3.1. EXTRA
|
|
788
|
-----------------------------------------------------
|
|
789
|
|
|
790
|
SECTION: EXTRA
|
|
791
|
|
|
792
|
CONTEXT: general comment (REQUIRED SECTION)
|
|
793
|
|
|
794
|
PURPOSE:
|
|
795
|
Title of a general comment.
|
|
796
|
|
|
797
|
CONTENT:
|
|
798
|
This section starts a new general comment. The content is used as
|
|
799
|
the title of the comment table.
|
|
800
|
|
|
801
|
The title must be present, but quite short (only a few words), and
|
|
802
|
must not use HTML markup.
|
|
803
|
|
|
804
|
|
|
805
|
3.3.2. COMMENT
|
|
806
|
-----------------------------------------------------
|
|
807
|
|
|
808
|
SECTION: COMMENT
|
|
809
|
|
|
810
|
CONTEXT: general comment
|
|
811
|
|
|
812
|
PURPOSE:
|
|
813
|
Contains a general, plain comment.
|
|
814
|
|
|
815
|
CONTENT:
|
|
816
|
This comment is just plain text which may be decorated by HTML
|
|
817
|
markup. Links to known classes will be created automatically.
|
|
818
|
|
|
819
|
|
|
820
|
|
|
821
|
3.3.3. HASHMAP
|
|
822
|
-----------------------------------------------------
|
|
823
|
|
|
824
|
SECTION: HASHMAP
|
|
825
|
|
|
826
|
CONTEXT: general comment
|
|
827
|
|
|
828
|
PURPOSE:
|
|
829
|
A map of key-value-pairs. A table with two columns will be generated
|
|
830
|
for that.
|
|
831
|
|
|
832
|
CONTENT:
|
|
833
|
The content consists of key-value-pairs.
|
|
834
|
|
|
835
|
The key is a free text, but it must not contain HTML markup.
|
|
836
|
|
|
837
|
In the same line of the key, the hash operator '=>' must follow.
|
|
838
|
|
|
839
|
After that, the description follows. The description may extend to
|
|
840
|
the next lines. It is stopped as soon as a new line with the hash
|
|
841
|
operator '=>', or the end of the comment block, was found.
|
|
842
|
|
|
843
|
The description may contain HTML markup. Known class names will be
|
|
844
|
linked automatically.
|
|
845
|
|
|
846
|
|
|
847
|
|
|
848
|
3.4. Method comments
|
|
849
|
-----------------------------------------------------
|
|
850
|
|
|
851
|
This comment block is to be put before each method. It describes the
|
|
852
|
purpose, and the input and return values, of this method.
|
|
853
|
|
|
854
|
Since OOPerlDoc ignores the program code itself, it is not required
|
|
855
|
that the method comment is placed before the 'sub' definition of the
|
|
856
|
method (anyhow we encourage you to do so). Besides that, you can also
|
|
857
|
create method comments without methods, e.g. to define abstract
|
|
858
|
methods.
|
|
859
|
|
|
860
|
These sections can be used within a method comment (a detailed
|
|
861
|
description will follow below):
|
|
862
|
|
|
863
|
METHOD The name of the method. Required!
|
|
864
|
|
|
865
|
FUNCTION If the Perl package is not object oriented, but a
|
|
866
|
procedural module, you should use FUNCTION instead
|
|
867
|
of METHOD. Required!
|
|
868
|
|
|
869
|
DESCRIPTION Description about the functionality of the method.
|
|
870
|
Required!
|
|
871
|
|
|
872
|
NOTE Important note about this method. This note will be
|
|
873
|
shown separately, with a "Note:" written before,
|
|
874
|
so it will easily be seen. (Optional)
|
|
875
|
|
|
876
|
INPUT A list of all mandatory input parameters.
|
|
877
|
|
|
878
|
OPTIONAL A list of all optional input parameters.
|
|
879
|
|
|
880
|
RETURN A list of all return values.
|
|
881
|
|
|
882
|
THROWS A list of all exceptions this method generates.
|
|
883
|
|
|
884
|
AUTHOR Author(s) of this method, if different from the
|
|
885
|
AUTHOR section of the class comment.
|
|
886
|
|
|
887
|
VERSION Version of this method.
|
|
888
|
|
|
889
|
DEPRECATED If the method is deprecated, you can explain the
|
|
890
|
reasons here, and how the programmer can replace the
|
|
891
|
functionality.
|
|
892
|
|
|
893
|
SEE Cross references to other methods, classes and
|
|
894
|
further information about the topic.
|
|
895
|
|
|
896
|
SINCE Version of the software where this method has been
|
|
897
|
introduced. This is important for backward
|
|
898
|
compatibility.
|
|
899
|
|
|
900
|
This is an example of the valid method comment.
|
|
901
|
|
|
902
|
##------------------------------------------------------
|
|
903
|
# METHOD:
|
|
904
|
# public: get_names
|
|
905
|
#
|
|
906
|
# DESCRIPTION:
|
|
907
|
# Get a list of all names. If no name does exist,
|
|
908
|
# undef will be returned.
|
|
909
|
#
|
|
910
|
# NOTE:
|
|
911
|
# Due to a bug, previous versions returned 0 instead
|
|
912
|
# of undef.
|
|
913
|
#
|
|
914
|
# INPUT:
|
|
915
|
# $id -- Name list ID to be fetched
|
|
916
|
#
|
|
917
|
# RETURN:
|
|
918
|
# List of all names, or undef
|
|
919
|
#-------------------------------------------------------
|
|
920
|
|
|
921
|
|
|
922
|
|
|
923
|
3.4.1. METHOD
|
|
924
|
-----------------------------------------------------
|
|
925
|
|
|
926
|
SECTION: METHOD
|
|
927
|
|
|
928
|
CONTEXT: method comment (REQUIRED SECTION)
|
|
929
|
|
|
930
|
PURPOSE:
|
|
931
|
This section introduces a method comment, by describing the method
|
|
932
|
name. If the Perl module is not a class, but a procedural module,
|
|
933
|
you should use FUNCTION instead of METHOD (see 3.4.2).
|
|
934
|
|
|
935
|
CONTENT:
|
|
936
|
The section only contains the method name, which is optionally
|
|
937
|
preceeded by modifiers. The list of modifiers is separated by
|
|
938
|
space and terminated by a colon.
|
|
939
|
|
|
940
|
[modifier [' ' modifier ...] ': '] method_name
|
|
941
|
|
|
942
|
If no modifiers are given, you may leave out the colon. The method
|
|
943
|
is then regarded as public.
|
|
944
|
|
|
945
|
You are not allowed to add further text.
|
|
946
|
|
|
947
|
These modifiers are allowed:
|
|
948
|
|
|
949
|
public Public method. All classes can invoke it.
|
|
950
|
|
|
951
|
protected Protected method. Only the superclass and all
|
|
952
|
derivated classes are allowed to invoke it.
|
|
953
|
|
|
954
|
private Private method. Only the class it self is allowed to
|
|
955
|
invoke it. Private methods are not documented by
|
|
956
|
OOPerlDoc unless required. By convention, private
|
|
957
|
method names always start with an underscore.
|
|
958
|
|
|
959
|
constructor A constructor of this class. Usually named as 'new'.
|
|
960
|
|
|
961
|
destructor The destructor of this class. Perl only allows one
|
|
962
|
destructor, which must have the name 'DESTROY'.
|
|
963
|
|
|
964
|
static Class method. No instance is needed to invoke this
|
|
965
|
method.
|
|
966
|
|
|
967
|
hybrid Class and instance method. This method does not care
|
|
968
|
if invoked as class method, or instance method. This
|
|
969
|
is a Perl speciality. Implies 'static'.
|
|
970
|
|
|
971
|
abstract This method is not implemented in this class, but
|
|
972
|
must be implemented at one of its derivates. If at
|
|
973
|
least one method is declared as abstract, you must
|
|
974
|
declare the whole class as abstract (see CLASS,
|
|
975
|
3.1.1.).
|
|
976
|
|
|
977
|
final This method must not be replaced in a subclass.
|
|
978
|
|
|
979
|
deprecated The method is deprecated, and may be removed in
|
|
980
|
future releases of this class. Do not use it in new
|
|
981
|
programs.
|
|
982
|
|
|
983
|
EXAMPLE:
|
|
984
|
|
|
985
|
:
|
|
986
|
# METHOD
|
|
987
|
# get_name
|
|
988
|
:
|
|
989
|
|
|
990
|
:
|
|
991
|
# METHOD
|
|
992
|
# public static: get_name_by_id
|
|
993
|
:
|
|
994
|
|
|
995
|
:
|
|
996
|
# METHOD
|
|
997
|
# private: _convert_id
|
|
998
|
:
|
|
999
|
|
|
1000
|
|
|
1001
|
3.4.2. FUNCTION
|
|
1002
|
-----------------------------------------------------
|
|
1003
|
|
|
1004
|
SECTION: FUNCTION
|
|
1005
|
|
|
1006
|
CONTEXT: method comment (REQUIRED SECTION)
|
|
1007
|
|
|
1008
|
PURPOSE:
|
|
1009
|
Contains the name of the function. If the module is written in a
|
|
1010
|
procedural fashion instead of OOP, use FUNCTION instead of METHOD.
|
|
1011
|
|
|
1012
|
CONTENT:
|
|
1013
|
Only the name of the function is allowed here. No modifiers, or
|
|
1014
|
other additions. In an OOP context, FUNCTIONs are always regarded as
|
|
1015
|
"public static final" (see 3.4.1.).
|
|
1016
|
|
|
1017
|
EXAMPLE:
|
|
1018
|
|
|
1019
|
:
|
|
1020
|
# FUNCTION
|
|
1021
|
# set_command_id
|
|
1022
|
:
|
|
1023
|
|
|
1024
|
|
|
1025
|
|
|
1026
|
3.4.3. DESCRIPTION
|
|
1027
|
-----------------------------------------------------
|
|
1028
|
|
|
1029
|
SECTION: DESCRIPTION
|
|
1030
|
|
|
1031
|
CONTEXT: method comment (REQUIRED SECTION)
|
|
1032
|
|
|
1033
|
PURPOSE:
|
|
1034
|
Describes the purpose of this method or function.
|
|
1035
|
|
|
1036
|
The first sentence will also be used in the method summary at the
|
|
1037
|
top of the documentation. This sentence should be quite short and
|
|
1038
|
self-explaining.
|
|
1039
|
|
|
1040
|
CONTENT:
|
|
1041
|
This is plain text. HTML markup is allowed. Known class names will
|
|
1042
|
be linked to the appropriate documentation automatically.
|
|
1043
|
|
|
1044
|
NOTE:
|
|
1045
|
OOPerlDoc regards the end of the first sentence at the first period
|
|
1046
|
it finds, or at the end of the only sentence. Thus, try to avoid
|
|
1047
|
periods in the first sentence which could be mixed up.
|
|
1048
|
|
|
1049
|
Example: For the description "Calculates pi as 3.141592", OOPerlDoc
|
|
1050
|
would extract "Calculates as to 3." as the first sentence.
|
|
1051
|
|
|
1052
|
EXAMPLE:
|
|
1053
|
|
|
1054
|
:
|
|
1055
|
# DESCRIPTION
|
|
1056
|
# Get a list of all members. The member list is sorted
|
|
1057
|
# alphabetically by the member name. If the list is empty,
|
|
1058
|
# undef is returned instead.
|
|
1059
|
:
|
|
1060
|
|
|
1061
|
|
|
1062
|
3.4.4. NOTE
|
|
1063
|
-----------------------------------------------------
|
|
1064
|
|
|
1065
|
SECTION: NOTE
|
|
1066
|
|
|
1067
|
CONTEXT: method comment
|
|
1068
|
|
|
1069
|
PURPOSE:
|
|
1070
|
Important note about this method or function. Optional. The
|
|
1071
|
purpose is to give the user very important information about
|
|
1072
|
how to use this method and to avoid bugs.
|
|
1073
|
|
|
1074
|
CONTENT:
|
|
1075
|
This is plain text. HTML markup is allowed. Known class names will
|
|
1076
|
be linked to the appropriate documentation automatically.
|
|
1077
|
|
|
1078
|
EXAMPLE:
|
|
1079
|
|
|
1080
|
:
|
|
1081
|
# NOTE
|
|
1082
|
# This method may also return undef, which may be a little
|
|
1083
|
# unexpected in some situations. Always check for it!
|
|
1084
|
:
|
|
1085
|
|
|
1086
|
|
|
1087
|
3.4.5. INPUT
|
|
1088
|
-----------------------------------------------------
|
|
1089
|
|
|
1090
|
SECTION: INPUT
|
|
1091
|
|
|
1092
|
CONTEXT: method comment
|
|
1093
|
|
|
1094
|
PURPOSE:
|
|
1095
|
List of all required input parameters passed to this method.
|
|
1096
|
Optional input parameters are listed in the OPTIONAL section (see
|
|
1097
|
3.4.5.). If there are no required parameters for this method, you
|
|
1098
|
can skip this section.
|
|
1099
|
|
|
1100
|
CONTENT:
|
|
1101
|
This section optionally starts with a plain text. This text may use
|
|
1102
|
HTML markup. Known class names will be linked to the appropriate
|
|
1103
|
documentation automatically.
|
|
1104
|
|
|
1105
|
After the optional plain text, several variable descriptions or
|
|
1106
|
key-value-pairs may follow.
|
|
1107
|
|
|
1108
|
A variable description starts with the variable name in a new line,
|
|
1109
|
followed by a space (!) and two minus signs ' --', followed by the
|
|
1110
|
description of that variable. The description may contain HTML
|
|
1111
|
markup and may extend by several lines. It is stopped as soon as a
|
|
1112
|
new variable name and the two minus signs are recognized in a line.
|
|
1113
|
|
|
1114
|
The variable name must follow certain syntax rules, to be recognized
|
|
1115
|
properly. It may start with a backslash '\' (which means reference),
|
|
1116
|
followed by a symbol that describes the variable type (one of '$',
|
|
1117
|
'@', '%', '&' and '*'), followed by the variable name itself.
|
|
1118
|
|
|
1119
|
If you pass a hash list to the method, you can also use
|
|
1120
|
key-value pairs. Here, you start with the key name, followed by the
|
|
1121
|
hash operator '=>', followed by the description. The description may
|
|
1122
|
contain HTML markup.
|
|
1123
|
|
|
1124
|
EXAMPLE:
|
|
1125
|
|
|
1126
|
:
|
|
1127
|
# INPUT:
|
|
1128
|
# \@hash_hr -- Hash reference that contains further
|
|
1129
|
# details for the process.
|
|
1130
|
# $name -- Some name
|
|
1131
|
:
|
|
1132
|
|
|
1133
|
:
|
|
1134
|
# INPUT:
|
|
1135
|
# Some values in loose order
|
|
1136
|
:
|
|
1137
|
|
|
1138
|
:
|
|
1139
|
# INPUT:
|
|
1140
|
# This method expects these parameters:
|
|
1141
|
# \@hash_hr -- Hash reference that contains further
|
|
1142
|
# details for the process.
|
|
1143
|
# $name -- Some name
|
|
1144
|
:
|
|
1145
|
|
|
1146
|
:
|
|
1147
|
# INPUT:
|
|
1148
|
# This method expects a hash with these parameters, in
|
|
1149
|
# loose order:
|
|
1150
|
# hash_hr => Hash reference that contains further
|
|
1151
|
# details for the process.
|
|
1152
|
# name => Some name
|
|
1153
|
:
|
|
1154
|
|
|
1155
|
|
|
1156
|
3.4.6. OPTIONAL
|
|
1157
|
-----------------------------------------------------
|
|
1158
|
|
|
1159
|
SECTION: OPTIONAL
|
|
1160
|
|
|
1161
|
CONTEXT: method comment
|
|
1162
|
|
|
1163
|
PURPOSE:
|
|
1164
|
List of all optional input parameters passed to this method.
|
|
1165
|
Mandatory input parameters are listed in the INPUT section (see
|
|
1166
|
3.4.4.). If there are no optional parameters for this method, you
|
|
1167
|
can skip this section.
|
|
1168
|
|
|
1169
|
CONTENT:
|
|
1170
|
See INPUT (3.4.4.).
|
|
1171
|
|
|
1172
|
EXAMPLE:
|
|
1173
|
|
|
1174
|
:
|
|
1175
|
# OPTIONAL:
|
|
1176
|
# You may also pass these parameters, in loose order:
|
|
1177
|
# hash_hr => Hash reference that contains further
|
|
1178
|
# details for the process.
|
|
1179
|
# name => Some name
|
|
1180
|
:
|
|
1181
|
|
|
1182
|
|
|
1183
|
|
|
1184
|
3.4.7. RETURN
|
|
1185
|
-----------------------------------------------------
|
|
1186
|
|
|
1187
|
SECTION: RETURN
|
|
1188
|
|
|
1189
|
CONTEXT: method comment
|
|
1190
|
|
|
1191
|
PURPOSE:
|
|
1192
|
List of all values returned from this method. Usually, this will
|
|
1193
|
only be one value, but since Perl can also return lists and hashes,
|
|
1194
|
you can also list more than one value here.
|
|
1195
|
|
|
1196
|
CONTENT:
|
|
1197
|
See INPUT (3.4.4.).
|
|
1198
|
|
|
1199
|
EXAMPLE:
|
|
1200
|
|
|
1201
|
:
|
|
1202
|
# RETURN:
|
|
1203
|
# List of all names, or undef.
|
|
1204
|
:
|
|
1205
|
|
|
1206
|
:
|
|
1207
|
# RETURN:
|
|
1208
|
# Returns a hash, with these keys:
|
|
1209
|
# name => User name
|
|
1210
|
# street => User address
|
|
1211
|
# phone => User phone number
|
|
1212
|
:
|
|
1213
|
|
|
1214
|
|
|
1215
|
3.4.8. THROWS
|
|
1216
|
-----------------------------------------------------
|
|
1217
|
|
|
1218
|
SECTION: THROWS
|
|
1219
|
|
|
1220
|
CONTEXT: method comment
|
|
1221
|
|
|
1222
|
PURPOSE:
|
|
1223
|
Documents all exceptions this method can throw.
|
|
1224
|
|
|
1225
|
CONTENT:
|
|
1226
|
First, the verbatim exception text is written (in quotation marks,
|
|
1227
|
optionally), followed by a space (!) and two minus signs ' --',
|
|
1228
|
followed by a detailed description of this exception.
|
|
1229
|
|
|
1230
|
You must not use HTML markup in the exception text. But you may
|
|
1231
|
prefix replacers with a dollar sign (e.g. "user $username is
|
|
1232
|
unknown").
|
|
1233
|
|
|
1234
|
The description may use HTML markup and may also extend over several
|
|
1235
|
lines. The description is finished when a new exception text is
|
|
1236
|
recognized (by the ' --') or when the section is finished.
|
|
1237
|
|
|
1238
|
NOTE:
|
|
1239
|
The THROWS section only contains exceptions this method will throw.
|
|
1240
|
This list is incomplete, because the method may call other methods
|
|
1241
|
which in turn may throw other exceptions.
|
|
1242
|
|
|
1243
|
EXAMPLE:
|
|
1244
|
|
|
1245
|
:
|
|
1246
|
# THROWS:
|
|
1247
|
# "Unknown user $name" -- User is not known, thus
|
|
1248
|
# you are not allowed to access the system.
|
|
1249
|
# "User access expired" -- User does exist, but his
|
|
1250
|
# account has expired.
|
|
1251
|
:
|
|
1252
|
|
|
1253
|
|
|
1254
|
3.4.9. AUTHOR
|
|
1255
|
-----------------------------------------------------
|
|
1256
|
|
|
1257
|
SECTION: AUTHOR
|
|
1258
|
|
|
1259
|
CONTEXT: method comment
|
|
1260
|
|
|
1261
|
SEE: class comment's AUTHOR section: 3.1.????
|
|
1262
|
|
|
1263
|
|
|
1264
|
3.4.10. VERSION
|
|
1265
|
-----------------------------------------------------
|
|
1266
|
|
|
1267
|
SECTION: VERSION
|
|
1268
|
|
|
1269
|
CONTEXT: method comment
|
|
1270
|
|
|
1271
|
SEE: class comment's VERSION section: 3.1.????
|
|
1272
|
|
|
1273
|
|
|
1274
|
|
|
1275
|
3.4.11. DEPRECATED
|
|
1276
|
-----------------------------------------------------
|
|
1277
|
|
|
1278
|
SECTION: DEPRECATED
|
|
1279
|
|
|
1280
|
CONTEXT: method comment
|
|
1281
|
|
|
1282
|
PURPOSE:
|
|
1283
|
Contains further details about the deprecation.
|
|
1284
|
|
|
1285
|
CONTENT:
|
|
1286
|
If you have marked a method as deprecated (by the deprecated
|
|
1287
|
modifier, see 3.4.1.), you are encouraged to write in this section:
|
|
1288
|
|
|
1289
|
* Since which version has this method been deprecated?
|
|
1290
|
* Why has the method been deprecated?
|
|
1291
|
* How can the functionality be replaced? (i.e. is there a new
|
|
1292
|
method that replaces this method?)
|
|
1293
|
|
|
1294
|
EXAMPLE:
|
|
1295
|
|
|
1296
|
:
|
|
1297
|
# DEPRECATED:
|
|
1298
|
# This method has been deprecated because of several
|
|
1299
|
# cleanups we have done to this class. You can now use
|
|
1300
|
# <code>get_info</code> instead, and pass INFO_NAME
|
|
1301
|
# there to get the information you got before.
|
|
1302
|
# <p>
|
|
1303
|
# This method will be removed in a future version of
|
|
1304
|
# the class. Do not use it in new code.
|
|
1305
|
:
|
|
1306
|
|
|
1307
|
|
|
1308
|
3.4.12. SEE
|
|
1309
|
-----------------------------------------------------
|
|
1310
|
|
|
1311
|
SECTION: SEE
|
|
1312
|
|
|
1313
|
CONTEXT: method comment
|
|
1314
|
|
|
1315
|
PURPOSE:
|
|
1316
|
Cross reference to other methods and further information about the
|
|
1317
|
topic.
|
|
1318
|
|
|
1319
|
CONTENT:
|
|
1320
|
A link to everything that is related to this method, as other
|
|
1321
|
methods, classes, literature, etc.
|
|
1322
|
|
|
1323
|
You may use HTML markup here. Known class names will be linked.
|
|
1324
|
|
|
1325
|
EXAMPLE:
|
|
1326
|
|
|
1327
|
:
|
|
1328
|
# SEE:
|
|
1329
|
# get_as_png,
|
|
1330
|
# <a href="http://www.libpng.org/pub/png/">PNG specs</a>
|
|
1331
|
:
|
|
1332
|
|
|
1333
|
|
|
1334
|
|
|
1335
|
|
|
1336
|
3.4.13. SINCE
|
|
1337
|
-----------------------------------------------------
|
|
1338
|
|
|
1339
|
SECTION: SINCE
|
|
1340
|
|
|
1341
|
CONTEXT: method comment
|
|
1342
|
|
|
1343
|
PURPOSE:
|
|
1344
|
Version of this class or software, when this method has been
|
|
1345
|
introduced.
|
|
1346
|
|
|
1347
|
CONTENT:
|
|
1348
|
Describes the version of the class or entire software package where
|
|
1349
|
this class has been introduced. A programmer will know that this
|
|
1350
|
version is required to invoke this method.
|
|
1351
|
|
|
1352
|
The format is equal to VERSION (3.1.7.), see there.
|
|
1353
|
|
|
1354
|
EXAMPLE:
|
|
1355
|
|
|
1356
|
:
|
|
1357
|
# SINCE:
|
|
1358
|
# V2.1.3 (2000-04-12)
|
|
1359
|
:
|
|
1360
|
|
|
1361
|
|
|
1362
|
|
|
1363
|
3.5. CIPP object comments
|
|
1364
|
-----------------------------------------------------
|
|
1365
|
|
|
1366
|
This new comment type has been introduced with OOPerlDoc V1.20.
|
|
1367
|
|
|
1368
|
It is used to comment CIPP objects. CIPP is a web development add-on
|
|
1369
|
for Perl, comparable to JSP or PHP.
|
|
1370
|
|
|
1371
|
A CIPP object block is a combination of a Class comment and a Method
|
|
1372
|
comment. While it is used like a Class comment, it also allows a list
|
|
1373
|
of INPUT, OPTIONAL and RETURN parameters. OOPerlDoc will generate a
|
|
1374
|
virtual Method comment for those parameters, with the Method name
|
|
1375
|
taken from the Class name.
|
|
1376
|
|
|
1377
|
Note that you must use this block instead of and like a Class comment
|
|
1378
|
block (see 3.1). This means that you must not use this block more than
|
|
1379
|
once per file, and if you are using it, you must not use a Class
|
|
1380
|
comment block.
|
|
1381
|
|
|
1382
|
These sections can be used within a CIPP object comment:
|
|
1383
|
|
|
1384
|
CIPPOBJECT The name of the CIPP object. Required!
|
|
1385
|
|
|
1386
|
PURPOSE A description of the CIPP object. This will also be
|
|
1387
|
used as the description of the virtual method block.
|
|
1388
|
|
|
1389
|
NOTE Important note about this object. This note will be
|
|
1390
|
shown separately, with a "Note:" written before,
|
|
1391
|
so it will easily be seen. (Optional)
|
|
1392
|
|
|
1393
|
INPUT A list of all mandatory input parameters.
|
|
1394
|
|
|
1395
|
OPTIONAL A list of all optional input parameters.
|
|
1396
|
|
|
1397
|
RETURN A list of all return values.
|
|
1398
|
|
|
1399
|
THROWS A list of all exceptions this method generates.
|
|
1400
|
|
|
1401
|
REQUIRES Other modules, classes and programs this class
|
|
1402
|
depends on.
|
|
1403
|
|
|
1404
|
DEPRECATED If the class has been deprecated, use this section.
|
|
1405
|
State the reason of deprecation and show a possible
|
|
1406
|
replacement here.
|
|
1407
|
|
|
1408
|
AUTHOR Author(s) of this class.
|
|
1409
|
|
|
1410
|
VERSION Version and date.
|
|
1411
|
|
|
1412
|
CVS Reserved for CVS version ID.
|
|
1413
|
|
|
1414
|
HISTORY Change history of this class.
|
|
1415
|
|
|
1416
|
SEE Cross references to other classes and further
|
|
1417
|
information about the topic.
|
|
1418
|
|
|
1419
|
COPYRIGHT Copyright note.
|
|
1420
|
|
|
1421
|
SINCE Version of the software where this class has been
|
|
1422
|
introduced. This is important for backward
|
|
1423
|
compatibility.
|
|
1424
|
|
|
1425
|
This is an example of the valid CIPP object comment.
|
|
1426
|
|
|
1427
|
##------------------------------------------------------
|
|
1428
|
# CIPPOBJECT:
|
|
1429
|
# public: x.example.object
|
|
1430
|
#
|
|
1431
|
# DESCRIPTION:
|
|
1432
|
# This is an example of the CIPPOBJECT header. This
|
|
1433
|
# text is also used to describe the virtual method.
|
|
1434
|
#
|
|
1435
|
# NOTE:
|
|
1436
|
# This object requires a properly configured x.config
|
|
1437
|
# file!
|
|
1438
|
#
|
|
1439
|
# INPUT:
|
|
1440
|
# $id -- Object ID to be fetched
|
|
1441
|
#
|
|
1442
|
# OPTIONAL:
|
|
1443
|
# $sort -- Table column to be assorted.
|
|
1444
|
#
|
|
1445
|
# REQUIRES:
|
|
1446
|
# data::dumper
|
|
1447
|
#
|
|
1448
|
# AUTHOR:
|
|
1449
|
# Richard K?rber <dev@shredzone.de>
|
|
1450
|
#
|
|
1451
|
# VERSION:
|
|
1452
|
# V1.0 (2000-08-22)
|
|
1453
|
#-------------------------------------------------------
|
|
1454
|
|
|
1455
|
|
|
1456
|
A. Legal Stuff and Kudos
|
|
1457
|
-----------------------------------------------------
|
|
1458
|
|
|
1459
|
OOPerlDoc is distributed under the GPL (GNU General Public Licence).
|
|
1460
|
|
|
1461
|
OOPerlDoc is free software; you can redistribute it and/or modify it
|
|
1462
|
under the terms of the GNU General Public License as published by the
|
|
1463
|
Free Software Foundation; either version 2 of the License, or (at your
|
|
1464
|
option) any later version.
|
|
1465
|
|
|
1466
|
OOPerlDoc is distributed in the hope that it will be useful, but
|
|
1467
|
WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
1468
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
1469
|
General Public License for more details.
|
|
1470
|
|
|
1471
|
You should have received a copy of the GNU General Public License
|
|
1472
|
along with OOPerlDoc; if not, write to the Free Software Foundation,
|
|
1473
|
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
1474
|
|
|
1475
|
OOPerlDoc was written by Richard "Shred" K?rber for the dimedis GmbH
|
|
1476
|
(www.dimedis.de). I want to thank the CEO Mr. Halling for giving me
|
|
1477
|
the permission to publish OOPerlDoc under GPL.
|
|
1478
|
|
|
1479
|
|
|
1480
|
B. OOPerlDoc History
|
|
1481
|
-----------------------------------------------------
|
|
1482
|
|
|
1483
|
V1.22 (2002-09-13) rkoerber
|
|
1484
|
- BUGFIX: OOPerlDoc was caught in an endless loop when
|
|
1485
|
a class only consisted of private methods
|
|
1486
|
- BUGFIX: Private attributes were not sorted properly to the
|
|
1487
|
end of the list
|
|
1488
|
|
|
1489
|
V1.21 (2002-07-09) rkoerber
|
|
1490
|
- Optionally, the class' source code can be added to the
|
|
1491
|
documentation. It is fully linked, but does not have
|
|
1492
|
a decent syntax highlighting yet.
|
|
1493
|
- Circular inheritance will now be detected and leads to
|
|
1494
|
an error instead of an endless loop. [Bug 1435]
|
|
1495
|
|
|
1496
|
V1.20 (2002-05-16) rkoerber
|
|
1497
|
- Added new block type CIPPOBJECT
|
|
1498
|
- Made OOPerlDoc a little more error tolerant (e.g.
|
|
1499
|
accepts RETURN, RETURNS and OUTPUT now).
|
|
1500
|
|
|
1501
|
V1.19 (2002-04-25) rkoerber
|
|
1502
|
- ':' is now optional for delimiting method names. If it
|
|
1503
|
is ommitted, the last word is taken (which is usually
|
|
1504
|
the method name). Anyhow you are encouraged to write a
|
|
1505
|
colon!
|
|
1506
|
- BUGFIX: when a class just had one private method or
|
|
1507
|
one private class method, ooperldoc would hang in an
|
|
1508
|
infinite loop. Fixed.
|
|
1509
|
- BUGFIX: Class list of certain packets was always empty.
|
|
1510
|
|
|
1511
|
V1.18 (2002-03-21) rkoerber
|
|
1512
|
- Class list by name now shows appropriate package path
|
|
1513
|
- Besides '::' now '.' are allowed as package delimiter
|
|
1514
|
|
|
1515
|
V1.17 (2002-01-31) rkoerber
|
|
1516
|
- Now you can select in a third frame, what package classes
|
|
1517
|
you want to see.
|
|
1518
|
- You can have a view of the class names only.
|
|
1519
|
|
|
1520
|
V1.16 (2002-01-31) rkoerber
|
|
1521
|
- BUGFIX: References to classes in Foo::Bar notation was broken
|
|
1522
|
since the very beginning. And no one noticed that...
|
|
1523
|
- Now also references to class methods like Foo::Bar->meth() is
|
|
1524
|
linked to the appropriate place.
|
|
1525
|
- If a class name itself is not known, it is searched in the
|
|
1526
|
current packet as well.
|
|
1527
|
|
|
1528
|
V1.15 (2002-01-31) rkoerber
|
|
1529
|
- Deprecated attribute of methods are now also listed in the
|
|
1530
|
method summary.
|
|
1531
|
- Private method and attribute names (starting with an underscore)
|
|
1532
|
are now at the bottom of the method and attribute summary
|
|
1533
|
- Attribute summary is now sorted and a little prettier (attribute
|
|
1534
|
name comes first, followed by modifiers in brackets)
|
|
1535
|
- Method summary sentence now ends with HTML tags or double
|
|
1536
|
newlines
|
|
1537
|
|
|
1538
|
V1.14 (2002-01-25) rkoerber
|
|
1539
|
- BUGFIX: THROWS was broken, now fixed again
|
|
1540
|
|
|
1541
|
V1.13 (2002-01-18) rkoerber
|
|
1542
|
- Charset iso-8859-1 set in header
|
|
1543
|
|
|
1544
|
V1.12 (2001-11-09) rkoerber
|
|
1545
|
- BUGFIX: when --private was set, the attribute section was
|
|
1546
|
always empty
|
|
1547
|
- Attribute section now looks like class method section, and
|
|
1548
|
shows appropriate colors for public/protected/private.
|
|
1549
|
- Minor BUGFIX with trimming some trailing spaces
|
|
1550
|
|
|
1551
|
V1.11 (2001-11-09) rkoerber
|
|
1552
|
- Lists all known direct subclasses
|
|
1553
|
- The superclasses summary now shows the overridden methods
|
|
1554
|
- The superclasses title now links to the appropriate class
|
|
1555
|
|
|
1556
|
V1.10 (2001-11-07) rkoerber
|
|
1557
|
- Generated HTML is using stylesheets now
|
|
1558
|
- Minor HTML optimizations
|
|
1559
|
|
|
1560
|
V1.9 (2001-11-06) rkoerber
|
|
1561
|
- Added NOTE in class and method headers, to show up important
|
|
1562
|
notes which should be read carefully.
|
|
1563
|
|
|
1564
|
V1.8 (2001-03-13) rkoerber
|
|
1565
|
- Translated the source and documentation into English. Improved
|
|
1566
|
documentation. Revision bumped to honor this changes.
|
|
1567
|
- Now, also URLs with parameters will be recognized and linked.
|
|
1568
|
|
|
1569
|
V1.7 (2001-02-06) rkoerber
|
|
1570
|
- EXTENDS now also allows to list more than one superclass. But
|
|
1571
|
OOPerlDoc only evaluates the first one for now.
|
|
1572
|
- Files and directories starting with '.' or '~' will now be
|
|
1573
|
ignored. A new option allows to read temporary files though.
|
|
1574
|
- REQUIRES added
|
|
1575
|
- BUGFIX: The treeview of superclasses contained the '????' at the
|
|
1576
|
wrong position when the superclass was not known.
|
|
1577
|
|
|
1578
|
V1.6 (2001-02-05) rkoerber
|
|
1579
|
- Attribute list: nbsp used on empty cells, so Netscape will render
|
|
1580
|
the table properly.
|
|
1581
|
- Improved layout for color markings of public, protected and
|
|
1582
|
private methods.
|
|
1583
|
- OOPerlDoc will bark now if HTML markup is used in a section that
|
|
1584
|
does not allow markup.
|
|
1585
|
- BUGFIX: recursive reading of directories was only one level deep
|
|
1586
|
- CVS section added to class headers
|
|
1587
|
|
|
1588
|
V1.5 (2001-01-24) rkoerber
|
|
1589
|
- OPTIONAL added
|
|
1590
|
- BUGFIX: SINCE blocks were put out twice
|
|
1591
|
|
|
1592
|
V1.4 (2000-09-01) rkoerber
|
|
1593
|
- Color markings of public, protected and private methods
|
|
1594
|
|
|
1595
|
V1.3 (2000-08-30) rkoerber
|
|
1596
|
- Added empty line between two EXTRA comments
|
|
1597
|
- Creates links on methods like package::method() now, too
|
|
1598
|
|
|
1599
|
V1.2 (2000-08-25) rkoerber
|
|
1600
|
- BUGFIX: Superclass tree was in reversed order :)
|
|
1601
|
|
|
1602
|
V1.1 (2000-08-25) rkoerber
|
|
1603
|
- Added -t option to set a title
|
|
1604
|
- SINCE added
|
|
1605
|
- CLASS can be used as alias for NAME now
|
|
1606
|
- http links and undef will be recognized
|
|
1607
|
- BUGFIX: recursive directory scanning didn't work at all
|
|
1608
|
|
|
1609
|
V1.0 (2000-08-24) rkoerber
|
|
1610
|
- First release
|
|
1611
|
|