line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#=============================================================================== |
2
|
|
|
|
|
|
|
# |
3
|
|
|
|
|
|
|
# DESCRIPTION: Import events from XML |
4
|
|
|
|
|
|
|
# |
5
|
|
|
|
|
|
|
# AUTHOR: Aliaksandr P. Zahatski, |
6
|
|
|
|
|
|
|
#=============================================================================== |
7
|
|
|
|
|
|
|
#$Id$ |
8
|
|
|
|
|
|
|
package Flow::From::XML; |
9
|
2
|
|
|
2
|
|
23
|
use Flow; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
38
|
|
10
|
2
|
|
|
2
|
|
7
|
use base 'Flow'; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
104
|
|
11
|
2
|
|
|
2
|
|
2030
|
use XML::Flow; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
use strict; |
13
|
|
|
|
|
|
|
use warnings; |
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
|
|
|
|
|
|
|
|