NAME

Spreadsheet::Reader::ExcelXML::Types - A type library for the ExcelXML reader

DESCRIPTION

This documentation is written to explain ways to use this module. To use the general package for excel parsing out of the box please review the documentation for Workbooks , Worksheets , and Cells.

This is a Type::Library for this package. There are no real tricks here outside of the standard Type::Tiny stuf. For the cool number and date formatting implementation see Spreadsheet::Reader::Format::ParseExcelFormatStrings.

TYPES

XMLFile

This type checks that the value is a readable file (full path - no file find magic used) with an \.xml extention

coercions

none

XLSXFile

This type checks that the value is a readable file (full path - no file find magic used) with an \.xlsx, \.xlsm, or \.xml extention

coercions

none

IOFileType

This is set as an instance of 'IO::File'

coercions

    GlobRef: by blessing it into an IO::File instance 'via{ bless $_, 'IO::File' }'

    XLSXFile: by opening it as an IO::File instance 'via{ IO::File->new( $_, 'r' ); }'

    XMLFile: by opening it as an IO::File instance 'via{ IO::File->new( $_, 'r' ); }'

ParserType

For now this type checks that the parser type string == 'reader'. As future parser types are added to the package I will update this type.

coercions

    Str: this will lower case any other version of the string 'reader' (Reader| READER) to get it to pass

PositiveNum

This type checks that the value is a number and is greater than 0

coercions

none

NegativeNum

This type checks that the value is a number and is less than 0

coercions

none

ZeroOrUndef

This type allows the value to be the number 0 or undef

coercions

none

NotNegativeNum

This type checks that the value is a number and that the number is greater than or equal to 0

coercions

none

CellID

this is a value that passes the following regular expression test; qr/^[A-Z]{1,3}[1-9]\d*$/

coercions

none

SubString

This is a precurser type to ErrorString. It is used to perform the first layer of coersions so that error objects can be consumed as-is in this package when a subcomponent throws an object rather than a string as an error.

coercions

    Object: it will test the object for two methods and if either one is present it will use the results of that method as the string. The methods in order are; 'as_string' and 'message'

ErrorString

This is a string that can't match the following sequence /\)\n;/ #I don't even remember why that sequence is bad but it is

coercions

    SubString: by using the following substitution on the string; s/\)\n;/\);/g

NAMED COERCIONS

Excel_number_0

This is essentially a pass through coercion used as a convenience rather than writing the pass through each time a coercion is needed but no actual work should be performed on the value

SUPPORT

TODO

    1. The ErrorString type tests still needs a 'fail' case

AUTHOR

Jed Lund
jandrew@cpan.org

COPYRIGHT

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

The full text of the license can be found in the LICENSE file included with this module.

This software is copyrighted (c) 2016 by Jed Lund

DEPENDENCIES

SEE ALSO