« lib/Spreadsheet/Reader/ExcelXML/ZipReader/WorkbookProps.pm
↑ Summary
lib/Spreadsheet/Reader/ExcelXML/Cell.pm »
| 1 | package Spreadsheet::Reader::ExcelXML::XMLReader::WorkbookProps; | ||||||||||||||||||||||||||||
| 2 | 3 | our $AUTHORITY = 'cpan:JANDREW'; | |||||||||||||||||||||||||||
| 3 | 3 | ▶ | use version; our $VERSION = version->declare('v0.16.8'); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | ###LogSD warn "You uncovered internal logging statements for Spreadsheet::Reader::ExcelXML::XMLReader::WorkbookProps-$VERSION"; | ||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||
| 6 | 3 | ▶ | use Moose::Role; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | 3 | requires qw( | |||||||||||||||||||||||||||
| 8 | current_node_parsed good_load close_the_file | ||||||||||||||||||||||||||||
| 9 | parse_element squash_node advance_element_position | ||||||||||||||||||||||||||||
| 10 | ); | ||||||||||||||||||||||||||||
| 11 | 3 | ▶ | use Types::Standard qw( is_HashRef StrMatch Str ); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 12 | ###LogSD use Log::Shiras::Telephone; | ||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||
| 14 | #########1 Dispatch Tables 3#########4#########5#########6#########7#########8#########9 | ||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||
| 16 | 3 | my $method_lookup = { | |||||||||||||||||||||||||||
| 17 | Author => '_set_creator', | ||||||||||||||||||||||||||||
| 18 | LastAuthor => '_set_modified_by', | ||||||||||||||||||||||||||||
| 19 | Created => '_set_date_created', | ||||||||||||||||||||||||||||
| 20 | LastSaved => '_set_date_modified', | ||||||||||||||||||||||||||||
| 21 | }; | ||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||
| 23 | #########1 Public Attributes 3#########4#########5#########6#########7#########8#########9 | ||||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||
| 27 | #########1 Public Methods 3#########4#########5#########6#########7#########8#########9 | ||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||
| 29 | 4 | ▶ | sub load_unique_bits{ | ||||||||||||||||||||||||||
|
Subroutine
load_unique_bits: called CC=6 SCAR=18.4
Pod
documented
| |||||||||||||||||||||||||||||
| 30 | 4 | my( $self, ) = @_; | |||||||||||||||||||||||||||
| 31 | ###LogSD my $phone = Log::Shiras::Telephone->new( name_space => | ||||||||||||||||||||||||||||
| 32 | ###LogSD $self->get_all_space . '::_load_unique_bits', ); | ||||||||||||||||||||||||||||
| 33 | ###LogSD $phone->talk( level => 'debug', message => [ | ||||||||||||||||||||||||||||
| 34 | ###LogSD "Setting the WorkbookPropsInterface unique bits" ] ); | ||||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||
| 36 | # turn workbook properties into a hashref | ||||||||||||||||||||||||||||
| 37 | 4 | ▶ | if( (keys %{$self->current_node_parsed})[0] eq 'DocumentProperties' or $self->advance_element_position( 'DocumentProperties' ) ){ | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
(keys %{$self->current_node_parsed;})[0] eq "DocumentProperties" or $self->advance_element_position("DocumentProperties")
MC/DC0%0/2
(keys %{$self->current_node_parsed;})[0] eq "DocumentProperties" or $self->advance_element_position("DocumentProperties")
(keys %{$self->current_node_parsed;})[0] eq "DocumentProperties"
$self->advance_element_position("DocumentProperties")
Truth table33%1/3
A or B
A= (keys %{$self->current_node_parsed;})[0] eq "DocumentProperties"B= $self->advance_element_position("DocumentProperties")
| |||||||||||||||||||||||||||||
| 38 | 4 | my $properties = $self->squash_node( $self->parse_element ); | |||||||||||||||||||||||||||
| 39 | ###LogSD $phone->talk( level => 'trace', message =>[ | ||||||||||||||||||||||||||||
| 40 | ###LogSD "The parsed properties are:", $properties ] ); | ||||||||||||||||||||||||||||
| 41 | 4 | for my $header ( keys %$properties ){ | |||||||||||||||||||||||||||
| 42 | ###LogSD $phone->talk( level => 'debug', message => [ | ||||||||||||||||||||||||||||
| 43 | ###LogSD "processing header: $header" ] ); | ||||||||||||||||||||||||||||
| 44 | 21 | ▶ | if( exists $method_lookup->{$header} ){ | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 45 | 12 | my $method = $method_lookup->{$header}; | |||||||||||||||||||||||||||
| 46 | my $value = is_HashRef( $properties->{$header} ) ? | ||||||||||||||||||||||||||||
| 47 | 12 | ▶ | $properties->{$header}->{raw_text} : $properties->{$header}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 48 | ###LogSD $phone->talk( level => 'trace', message => [ | ||||||||||||||||||||||||||||
| 49 | ###LogSD "Implementing -$method- with value: $value" ] ); | ||||||||||||||||||||||||||||
| 50 | 12 | $self->$method( $value ); | |||||||||||||||||||||||||||
| 51 | } | ||||||||||||||||||||||||||||
| 52 | } | ||||||||||||||||||||||||||||
| 53 | 4 | $self->good_load( 1 ); | |||||||||||||||||||||||||||
| 54 | }else{ | ||||||||||||||||||||||||||||
| 55 | ###LogSD $phone->talk( level => 'warn', message =>[ "no cp:coreProperties found" ] ); | ||||||||||||||||||||||||||||
| 56 | } | ||||||||||||||||||||||||||||
| 57 | |||||||||||||||||||||||||||||
| 58 | ###LogSD $phone->talk( level => 'debug', message => [ | ||||||||||||||||||||||||||||
| 59 | ###LogSD "Closing out the xml file" ] ); | ||||||||||||||||||||||||||||
| 60 | 4 | $self->close_the_file; | |||||||||||||||||||||||||||
| 61 | } | ||||||||||||||||||||||||||||
| 62 | |||||||||||||||||||||||||||||
| 63 | #########1 Private Attributes 3#########4#########5#########6#########7#########8#########9 | ||||||||||||||||||||||||||||
| 64 | |||||||||||||||||||||||||||||
| 65 | 3 | has _file_creator =>( | |||||||||||||||||||||||||||
| 66 | isa => Str, | ||||||||||||||||||||||||||||
| 67 | reader => 'get_creator', | ||||||||||||||||||||||||||||
| 68 | writer => '_set_creator', | ||||||||||||||||||||||||||||
| 69 | clearer => '_clear_creator', | ||||||||||||||||||||||||||||
| 70 | ); | ||||||||||||||||||||||||||||
| 71 | |||||||||||||||||||||||||||||
| 72 | 3 | has _file_modified_by =>( | |||||||||||||||||||||||||||
| 73 | isa => Str, | ||||||||||||||||||||||||||||
| 74 | reader => 'get_modified_by', | ||||||||||||||||||||||||||||
| 75 | writer => '_set_modified_by', | ||||||||||||||||||||||||||||
| 76 | clearer => '_clear_modified_by', | ||||||||||||||||||||||||||||
| 77 | ); | ||||||||||||||||||||||||||||
| 78 | |||||||||||||||||||||||||||||
| 79 | 3 | has _file_date_created =>( | |||||||||||||||||||||||||||
| 80 | isa => StrMatch[qr/^\d{4}\-\d{2}\-\d{2}/], | ||||||||||||||||||||||||||||
| 81 | reader => 'get_date_created', | ||||||||||||||||||||||||||||
| 82 | writer => '_set_date_created', | ||||||||||||||||||||||||||||
| 83 | clearer => '_clear_date_created', | ||||||||||||||||||||||||||||
| 84 | ); | ||||||||||||||||||||||||||||
| 85 | |||||||||||||||||||||||||||||
| 86 | 3 | has _file_date_modified =>( | |||||||||||||||||||||||||||
| 87 | isa => StrMatch[qr/^\d{4}\-\d{2}\-\d{2}/], | ||||||||||||||||||||||||||||
| 88 | reader => 'get_date_modified', | ||||||||||||||||||||||||||||
| 89 | writer => '_set_date_modified', | ||||||||||||||||||||||||||||
| 90 | clearer => '_clear_date_modified', | ||||||||||||||||||||||||||||
| 91 | ); | ||||||||||||||||||||||||||||
| 92 | |||||||||||||||||||||||||||||
| 93 | #########1 Private Methods 3#########4#########5#########6#########7#########8#########9 | ||||||||||||||||||||||||||||
| 94 | |||||||||||||||||||||||||||||
| 95 | |||||||||||||||||||||||||||||
| 96 | |||||||||||||||||||||||||||||
| 97 | #########1 Phinish 3#########4#########5#########6#########7#########8#########9 | ||||||||||||||||||||||||||||
| 98 | |||||||||||||||||||||||||||||
| 99 | 3 | ▶ | no Moose::Role; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 100 | 3 | 1; | |||||||||||||||||||||||||||
| 101 | |||||||||||||||||||||||||||||
| 102 | #########1 Documentation 3#########4#########5#########6#########7#########8#########9 | ||||||||||||||||||||||||||||
| 103 | __END__ | ||||||||||||||||||||||||||||