Help-Site Computer Manuals
Software
Hardware
Programming
Networking
  Algorithms & Data Structures   Programming Languages   Revision Control
  Protocols
  Cameras   Computers   Displays   Keyboards & Mice   Motherboards   Networking   Printers & Scanners   Storage
  Windows   Linux & Unix   Mac

OLE::Storage_Lite
Simple Class for OLE document interface.

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


SYNOPSIS


  use OLE::Storage_Lite;

  use strict;

#1. Initialize

#1.1 From File

  my $oOl = OLE::Storage_Lite->new("some.xls");

#1.2 From Scalar

  my $oOl = OLE::Storage_Lite->new(\$sBuff);

#1.3 From IO::Handle object

  use IO::File;

  my $oIo = new IO::File;

  $oIo->open("<iofile.xls");

  binmode($oIo);

  my $oOl = OLE::Storage_Lite->new($oFile);

#2. Read and Get Data

  my $oPps = $oOl->getPpsTree(1);

#3.Save Data

#3.1 As File

  $oPps->save("kaba.xls"); #kaba.xls

  $oPps->save('-');        #STDOUT

#3.2 As Scalar

  $oPps->save(\$sBuff);

#3.3 As IO::Handle object

  my $oIo = new IO::File;

  $oIo->open(">iofile.xls");

  bimode($oIo);

  $oPps->save($oIo);


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.




=head2 new

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

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

From 0.06, $sFile may be a scalar reference of file contents (ex. \$sBuff) and IO::Handle object (including IO::File etc).

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][, $iCase] );

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. if $iCase is true, search with case insensitive.

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.

From 0.06, $sFile may be a scalar reference of file contents (ex. \$sBuff) and IO::Handle object (including IO::File etc).

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.




=head1 OLE::Storage_Lite::PPS::File

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

new

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

$sName is name of the PPS.

$sData is data of the PPS.

newFile

$oRoot = OLE::Storage_Lite::PPS::File->newFile($sName, $sFile);

This function makes to use file handle for geting and storing data.

$sName is name of the PPS.

If $sFile is scalar, it assumes that is a filename. If $sFile is an IO::Handle object, it uses that specified handle. If $sFile is undef or '', it uses temporary file.

CAUTION: Take care $sFile will be updated by append method. So if you want to use IO::Handle and append a data to it, you should open the handle with ``r+''.

append

$oRoot = $oPps->append($sData);

appends specified data to that PPS.

$sData is appending data for that 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 ...).


COPYRIGHT

The OLE::Storage_Lite module is Copyright (c) 2000,2001 Kawai Takanori. Japan. All rights reserved.

You may distribute under the terms of either the GNU General Public License or the Artistic License, as specified in the Perl README file.


ACKNOWLEDGEMENTS

First of all, I would like to acknowledge to Martin Schwartz and his module OLE::Storage.


AUTHOR

Kawai Takanori kwitknr@cpan.org

Currently maintained by John McNamara jmcnamara@cpan.org


SEE ALSO

OLE::Storage

Programminig
Wy
Wy
yW
Wy
Programming
Wy
Wy
Wy
Wy