line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Treemap::Input::XML; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
29607
|
use 5.006; |
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
38
|
|
4
|
1
|
|
|
1
|
|
6
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
37
|
|
5
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
38
|
|
6
|
1
|
|
|
1
|
|
5
|
use Carp; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
86
|
|
7
|
1
|
|
|
1
|
|
400
|
use XML::Simple; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
require Exporter; |
10
|
|
|
|
|
|
|
require Treemap::Input; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
our @ISA = qw( Treemap::Input Exporter ); |
13
|
|
|
|
|
|
|
our @EXPORT_OK = ( ); |
14
|
|
|
|
|
|
|
our @EXPORT = qw( ); |
15
|
|
|
|
|
|
|
our $VERSION = '0.01'; |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
# ------------------------------------------ |
19
|
|
|
|
|
|
|
# Methods: |
20
|
|
|
|
|
|
|
# ------------------------------------------ |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub load |
23
|
|
|
|
|
|
|
{ |
24
|
|
|
|
|
|
|
my $self = shift; |
25
|
|
|
|
|
|
|
my( $path ) = @_; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
if ( $self->{ DATA } = $self->_load( $path ) ) |
28
|
|
|
|
|
|
|
{ |
29
|
|
|
|
|
|
|
return 1; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
return 0; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
# ------------------------------------------ |
35
|
|
|
|
|
|
|
# ------------------------------------------ |
36
|
|
|
|
|
|
|
# Hey, look at that, XML loads right in as our tree map data structure. Ain't |
37
|
|
|
|
|
|
|
# that handy? |
38
|
|
|
|
|
|
|
# ------------------------------------------ |
39
|
|
|
|
|
|
|
sub _load |
40
|
|
|
|
|
|
|
{ |
41
|
|
|
|
|
|
|
my $self = shift; |
42
|
|
|
|
|
|
|
my( $path ) = @_; |
43
|
|
|
|
|
|
|
my $tree = XMLin( $path, keyattr => {}, forcearray => [ "children" ] ); |
44
|
|
|
|
|
|
|
return $tree; |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
1; |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
__END__ |