/usr/share/perl5/CQL/Utils.pm is in libcql-parser-perl 1.10-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 | package CQL::Utils;
use strict;
use warnings;
use base qw( Exporter );
our @EXPORT_OK = qw( indent xq renderPrefixes );
## not for public consumption
sub indent {
my $level = shift || 0;
return " " x $level;
}
sub xq {
my $string = shift || '';
$string =~ s/&/&/g;
$string =~ s/</</g;
$string =~ s/>/>/g;
return $string;
}
sub renderPrefixes {
my ($level, @prefixes) = @_;
return '' if @prefixes == 0;
my $buffer = indent($level)."<prefixes>\n";
for my $prefix (@prefixes) {
$buffer .= indent($level+1)."<prefix>\n";
$buffer .= indent($level+2)."<name>".$prefix->getName()."</name>\n"
if $prefix->getName();
$buffer .= indent($level+2)."<identifier>".$prefix->getIdentifier().
"</identifier>\n";
$buffer .= indent($level+1)."</prefix>\n";
}
$buffer .= indent($level)."</prefixes>\n";
}
1;
|