The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

OLE::Storage_Lite - Simple Class for OLE document interface.

SYNOPSIS

  use OLE::Storage_Lite;
  use strict;
  my $oOl = OLE::Storage_Lite->new("some.xls");
  my $oPps = $oOl->getPpsTree(1); #Read and Get Data 

  $oPps->save("kaba.xls", 1);     #Save Data as "kaba.xls"

DESCRIPTION

OLE::Storage_Lite allows you to read and write an OLE structured file. Please refer OLE::Storage by Martin Schwartz.

OLE::Storage_Lite::PPS is a class representing PPS. OLE::Storage_Lite::PPS::Root, OLE::Storage_Lite::PPS::File and OLE::Storage_Lite::PPS::Dir are subclasses of OLE::Storage_Lite::PPS.

new

$oOle = OLE::Storage_Lite->new($sFile);

Constructor. Creates a OLE::Storage_Lite object for $sFile. $sFile must be a correct file name.

getPpsTree

$oPpsRoot = oOle->getPpsTree([$bData]);

returns PPS as OLE::Storage_Lite::PPS::Root object. Other PPS objects will be included as its children. if $bData is true, the objects will have data in the file.

getPpsSearch

$oPpsRoot = oOle->getPpsTree($raName [, $bData]);

returns PPSs as OLE::Storage_Lite::PPS objects that has the name specified in $raName array. if $bData is true, the objects will have data in the file.

getNthPps

$oPpsRoot = oOle->getNthPps($iNth [, $bData]);

returns PPS as OLE::Storage_Lite::PPS object specified number($iNth). if $bData is true, the objects will have data in the file.

Asc2Ucs

$sUcs2 = OLE::Storage_Lite::Asc2Ucs($sAsc);

Utility function. Just adding 0x00 afeter every characters in $sAsc.

Ucs2Asc

$sAsc = OLE::Storage_Lite::Ucs2Asc($sUcs2);

Utility function. Just deletes 0x00 afeter words in $sUcs.

OLE::Storage_Lite::PPS

OLE::Storage_Lite::PPS has these properties:

No

order number in saving.

Name

its name in UCS2 (a.k.a Unicode).

Type

its type (1:Dir, 2:File (Data), 5: Root)

PrevPps

previous pps (as No)

NextPps

next pps (as No)

DirPps

dir pps (as No).

Time1st

timestamp1st in array ref as similar fomat of localtime.

Time2nd

timestamp2nd in array ref as similar fomat of localtime.

StartBlock

start block number

Size

size of the pps

Data

its data

Child

its child PPSs in array ref

OLE::Storage_Lite::PPS::Root

OLE::Storage_Lite::PPS::Root has 2 methods.

new

$oRoot = OLE::Storage_Lite::PPS::Root->new( $raTime1st, $raTime2nd, $raChild);

Constructor.

$raTime1st, $raTime2nd is a array ref as ($iSec, $iMin, $iHour, $iDay, $iMon, $iYear, $iHSec). $iSec means seconds, $iMin means minutes. $iHour means hours. $iDay means day. $iMon is month -1. $iYear is year - 1900. $iHSec is seconds/10,000,000 in Math::BigInt.

$raChild is a array ref of children PPSs.

save

$oRoot = $o<oRoot>->save( $sFile, $bNoAs);

Saves infomations into $sFile. $sFile is '-', this will use STDOUT.

if $bNoAs is defined, this function will use the No of PPSs for saving order. if $bNoAs is undefined, this will calculate PPS saving order.

OLE::Storage_Lite::PPS::Dir

OLE::Storage_Lite::PPS::Dir has 1 method.

new

$oRoot = OLE::Storage_Lite::PPS::Dir->new( $sName [, $raTime1st] [, $raTime2nd] [, $raChild]);

Constructor.

$sName is a name of the PPS.

$raTime1st, $raTime2nd is a array ref as ($iSec, $iMin, $iHour, $iDay, $iMon, $iYear, $iHSec). $iSec means seconds, $iMin means minutes. $iHour means hours. $iDay means day. $iMon is month -1. $iYear is year - 1900. $iHSec is seconds/10,000,000 in Math::BigInt.

$raChild is a array ref of children PPSs.

OLE::Storage_Lite::PPS::File

OLE::Storage_Lite::PPS::File has 1 method.

new

$oRoot = OLE::Storage_Lite::PPS::File->new($sName, $sData);

$sName is name of the PPS.

$sData is data of the PPS.

CAUTION

A saved file with VBA (a.k.a Macros) by this module will not work correctly. However modules can get the same information from the file, the file occurs a error in application(Word, Excel ...).

AUTHOR

Kawai Takanori GCD00051@nifty.ne.jp

SEE ALSO

OLE::Storage