]> Creatis software - clitk.git/blob - Doxygen/itkgroup.pl
Increase number of decimal for fusion and overlay
[clitk.git] / Doxygen / itkgroup.pl
1 # if regular doxycomment add a @{
2 # at next empty line add a //@}
3
4 $ingroup = 0;
5 $semicount =0;
6 $endbracecount = 0;
7 $endparencount = 0;
8 while(<>)
9 {
10     chomp;
11     $line = $_;
12 # if the line is not an empty line
13     if( $line =~ /\S+/ )
14     {
15         if ( /\/\*\*(.*)/ )
16         {
17             # I guess it was not a group, dump savebuffer
18             if($ingroup)
19             { 
20                 print "/**" . $savebuffer . "\n";
21             }
22             # if it is a class or brief then output the line but
23             # do not start a group
24             if ( /(\\class|\\brief)/ )
25             {
26                 print $line . "\n";
27             }
28             # must be a group so start saving
29             else
30             {
31                 $savebuffer = "$1" . "\n";
32                 $ingroup = 1;
33                 $semicount = 0;
34                 $endbracecount = 0;
35                 $endparencount = 0;
36             }
37         }
38         else
39         {
40             # add to save buffer if in group
41             if($ingroup)
42             {
43                 $savebuffer = $savebuffer . $_ . "\n";
44             }
45             else
46             {
47                 # non empty line that is not the start of a doxy comment
48                 print $_ . "\n";
49             }
50         }
51         if($line =~ /;/ )
52         {
53             $semicount = $semicount + 1;
54         }
55         if($line =~ /\}/ )
56         {
57             $endbracecount = $endbracecount + 1;
58         }
59         if($line =~ /\)/ )
60         {
61             $endparencount = $endparencount + 1;
62         }
63     }
64     else
65     {
66         if($ingroup)
67         {
68             if($endparencount > 1 && ($semicount > 1 || $endbracecount > 1))
69             {
70                 print "/**@\{" . $savebuffer . "//@}\n\n";
71             }
72             else
73             {
74                 print "/**" . $savebuffer . "\n";
75             }
76             $savebuffer = "";
77             $ingroup = 0;
78         }
79         else
80         {
81             print $line . "\n";
82         }
83     }
84 }