ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/SCRAM/src/ActiveDoc/GroupChecker.pm
(Generate patch)

Comparing COMP/SCRAM/src/ActiveDoc/GroupChecker.pm (file contents):
Revision 1.2 by williamc, Thu Jun 10 15:41:31 1999 UTC vs.
Revision 1.3 by williamc, Wed Jun 23 09:53:30 1999 UTC

# Line 15 | Line 15
15   #                      return 1 else 0
16   # getincluded()      : return an array of included groups
17   # getexcluded()      : return array of excluded groups
18 + # clearinclude()     : clear all entries from the include list
19 + # clearexclude()     : clear all entries from the exclude list
20   # ----------------------------------------------
21   # group names are characters. Anything before a :: will indicate the
22   # group set upon which the closecontext etc will operate. The group set is
# Line 34 | Line 36 | sub new {
36          return $self;
37   }
38  
39 + sub clearinclude {
40 +        my $self=shift;
41 +        undef %{$self->{include}};
42 + }
43 + sub clearexclude {
44 +        my $self=shift;
45 +        undef %{$self->{exclude}};
46 + }
47 +
48   sub exclude {
49          my $self=shift;
50          my $gp=shift;
# Line 79 | Line 90 | sub getincluded {
90   sub opencontext {
91          my $self=shift;
92          my $gp=shift;
93 +        my $set;
94  
95 <        ( $gp=~/(.*)::/ ? $set=$1 : $set='none' );
95 >        if ( $gp=~/(.*)::/ ) {
96 >          $set=$1;
97 >        }
98 >        else {
99 >         $set='none';
100 >        }
101          
102          push @{$self->{contextstack}{$set}}, $gp;
103          $self->{context}{$gp}=1;
# Line 95 | Line 112 | sub closelastcontext {
112          if ( $set eq "" ) { $set='none' }
113          do {
114             $gp=pop @{$self->{contextstack}{$set}};
115 <        } while ( ! exists $self->{context}{$gp} );
115 >        } while ( (! exists $self->{context}{$gp}) && ($gp eq "") );
116          $self->closecontext($gp);
117   }
118  
# Line 103 | Line 120 | sub closecontext {
120          my $self=shift;
121          my $gp=shift;
122  
123 <        ( $gp=~/(.*)::/ ? $set=$1 : $set='none' );
123 >        if ( $gp=~/(.*)::/ ) {
124 >          $set=$1;
125 >        }
126 >        else {
127 >         $set='none';
128 >        }
129          delete $self->{context}{$gp};
130          $self->_setstatus();
131   }
# Line 119 | Line 141 | sub _setstatus {
141          my $self=shift;
142          my $i;
143          
144 <        $self->{status}=0; # If not on exclude or include then always false
144 >        $self->{status}=1;
145          foreach $i ( keys %{$self->{context}} ) {
146              if ( ( exists $self->{include}{$i} )
147                   || ( exists $self->{include}{all} ) ) {
148 <                $self->{status}=1;
148 >                $self->{status}=( $self->{status} && 1);
149              }
150              if ( exists $self->{exclude}{$i} ) {
151                  $self->{status}=0;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines