line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#=============================================================================== |
2
|
|
|
|
|
|
|
# |
3
|
|
|
|
|
|
|
# DESCRIPTION: Import events from XML |
4
|
|
|
|
|
|
|
# |
5
|
|
|
|
|
|
|
# AUTHOR: Aliaksandr P. Zahatski, |
6
|
|
|
|
|
|
|
#=============================================================================== |
7
|
|
|
|
|
|
|
package Flow::From::XML; |
8
|
2
|
|
|
2
|
|
14
|
use Flow; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
62
|
|
9
|
2
|
|
|
2
|
|
12
|
use base 'Flow'; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
162
|
|
10
|
2
|
|
|
2
|
|
1939
|
use XML::Flow; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
use strict; |
12
|
|
|
|
|
|
|
use warnings; |
13
|
|
|
|
|
|
|
our $VERSION = '0.1'; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
=head2 new src |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
new Flow::From::XML:: \$str |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
=cut |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub new { |
22
|
|
|
|
|
|
|
my $class = shift; |
23
|
|
|
|
|
|
|
my $dst = shift; |
24
|
|
|
|
|
|
|
my $xflow = ( new XML::Flow:: $dst ); |
25
|
|
|
|
|
|
|
return $class->SUPER::new( @_, _xml_flow => $xflow, ); |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub begin { |
29
|
|
|
|
|
|
|
our $self = shift; |
30
|
|
|
|
|
|
|
$self->put_begin(@_); |
31
|
|
|
|
|
|
|
my $xfl = $self->{_xml_flow}; |
32
|
|
|
|
|
|
|
my %tags = ( |
33
|
|
|
|
|
|
|
flow => sub { shift; $self->put_flow( @{ shift @_ } ) }, |
34
|
|
|
|
|
|
|
ctl_flow => sub { shift; $self->put_ctl_flow( @{ shift(@_) } ) } |
35
|
|
|
|
|
|
|
); |
36
|
|
|
|
|
|
|
$xfl->read( \%tags ); |
37
|
|
|
|
|
|
|
$xfl->close; |
38
|
|
|
|
|
|
|
return; |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
1; |
41
|
|
|
|
|
|
|
|