line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
package IOC::Config::XML; |
3
|
|
|
|
|
|
|
|
4
|
4
|
|
|
4
|
|
133776
|
use strict; |
|
4
|
|
|
|
|
9
|
|
|
4
|
|
|
|
|
139
|
|
5
|
4
|
|
|
4
|
|
20
|
use warnings; |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
172
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '0.03'; |
8
|
|
|
|
|
|
|
|
9
|
4
|
|
|
4
|
|
2089
|
use IOC::Exceptions; |
|
4
|
|
|
|
|
14
|
|
|
4
|
|
|
|
|
150
|
|
10
|
4
|
|
|
4
|
|
3189
|
use IOC::Config::XML::SAX::Handler; |
|
4
|
|
|
|
|
25
|
|
|
4
|
|
|
|
|
167
|
|
11
|
|
|
|
|
|
|
|
12
|
4
|
|
|
4
|
|
4318
|
use XML::SAX::ParserFactory; |
|
4
|
|
|
|
|
22173
|
|
|
4
|
|
|
|
|
866
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub new { |
15
|
11
|
|
|
11
|
1
|
1896
|
my ($_class) = @_; |
16
|
11
|
|
33
|
|
|
82
|
my $class = ref($_class) || $_class; |
17
|
11
|
|
|
|
|
45
|
my $config = { |
18
|
|
|
|
|
|
|
_config => {} |
19
|
|
|
|
|
|
|
}; |
20
|
11
|
|
|
|
|
37
|
bless($config, $class); |
21
|
11
|
|
|
|
|
39
|
return $config; |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub read { |
25
|
31
|
|
|
31
|
1
|
15677
|
my ($self, $source) = @_; |
26
|
31
|
100
|
100
|
|
|
334
|
(defined($source) && $source) |
27
|
|
|
|
|
|
|
|| throw IOC::InsufficientArguments "You must provide something to read"; |
28
|
28
|
|
|
|
|
299
|
my $handler = IOC::Config::XML::SAX::Handler->new(); |
29
|
28
|
|
|
|
|
285
|
my $p = XML::SAX::ParserFactory->parser(Handler => $handler); |
30
|
28
|
100
|
|
|
|
369016
|
if ($source =~ /\.xml$/) { |
31
|
1
|
|
|
|
|
21
|
$p->parse_uri($source); |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
else { |
34
|
27
|
|
|
|
|
233
|
$p->parse_string($source); |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
1; |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
__END__ |