/usr/lib/perl5/ALTree/Sens.pm is in altree 1.3.1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 | package ALTree::Sens;
################################################################
################################################################
####################### Sens ##########################
################################################################
################################################################
use base 'ALTree::Base';
#Creation d'une structure
sub New { # [classe] sens
my $class=shift;
my $self={};
my $sens=shift;
bless($self, $class);
if ($sens !~ /^\s*([0-9a-zA-Z?]+)\s*[-=_]*[>]\s*([0-9a-zA-Z?]+)\s*$/) {
die "Invalid sens : $sens\n";
}
$self->_init("start" => $1, "end" => $2, "switch" => 0, @_);
return $self;
}
#Creation d'une structure
sub NewRev { # [classe] sens
my $class=shift;
my $self={};
my $sens=shift;
bless($self, $class);
$self->_init("start" => $sens->{"end"},
"end" => $sens->{"start"}, "switch" => 0, @_);
return $self;
}
sub _makeLabel {
my $self=shift;
my $start=shift;
my $end=shift;
if ($self->{'switch'}) {
return $end."-->".$start;
} else {
return $start."-->".$end;
}
}
sub GetLabel {
my $self=shift;
return $self->_makeLabel($self->{"start"}, $self->{"end"});
}
sub GetLabelRev {
my $self=shift;
return $self->_makeLabel($self->{"end"}, $self->{"start"});
}
sub Switch {
my $self=shift;
$self->{'switch'} = 1-$self->{'switch'};
}
1;
|