1Storage_Lite(3) User Contributed Perl Documentation Storage_Lite(3)
2
3
4
6 OLE::Storage_Lite - Simple Class for OLE document interface.
7
9 use OLE::Storage_Lite;
10 use strict;
11 #1. Initialize
12 #1.1 From File
13 my $oOl = OLE::Storage_Lite->new("some.xls");
14 #1.2 From Scalar
15 my $oOl = OLE::Storage_Lite->new(\$sBuff);
16 #1.3 From IO::Handle object
17 use IO::File;
18 my $oIo = new IO::File;
19 $oIo->open("<iofile.xls");
20 binmode($oIo);
21 my $oOl = OLE::Storage_Lite->new($oFile);
22 #2. Read and Get Data
23 my $oPps = $oOl->getPpsTree(1);
24 #3.Save Data
25 #3.1 As File
26 $oPps->save("kaba.xls"); #kaba.xls
27 $oPps->save('-'); #STDOUT
28 #3.2 As Scalar
29 $oPps->save(\$sBuff);
30 #3.3 As IO::Handle object
31 my $oIo = new IO::File;
32 $oIo->open(">iofile.xls");
33 bimode($oIo);
34 $oPps->save($oIo);
35
37 OLE::Storage_Lite allows you to read and write an OLE structured file.
38 Please refer OLE::Storage by Martin Schwartz.
39
40 OLE::Storage_Lite::PPS is a class representing PPS. OLE::Stor‐
41 age_Lite::PPS::Root, OLE::Storage_Lite::PPS::File and OLE::Stor‐
42 age_Lite::PPS::Dir are subclasses of OLE::Storage_Lite::PPS.
43
44 new
45
46 $oOle = OLE::Storage_Lite->new($sFile);
47
48 Constructor. Creates a OLE::Storage_Lite object for $sFile. $sFile
49 must be a correct file name.
50
51 From 0.06, $sFile may be a scalar reference of file contents (ex.
52 \$sBuff)
53 and IO::Handle object (including IO::File etc).
54
55 getPpsTree
56
57 $oPpsRoot = oOle->getPpsTree([$bData]);
58
59 returns PPS as OLE::Storage_Lite::PPS::Root object. Other PPS objects
60 will be included as its children. if $bData is true, the objects will
61 have data in the file.
62
63 getPpsSearch
64
65 $oPpsRoot = oOle->getPpsTree($raName [, $bData][, $iCase] );
66
67 returns PPSs as OLE::Storage_Lite::PPS objects that has the name speci‐
68 fied in $raName array. if $bData is true, the objects will have data
69 in the file. if $iCase is true, search with case insensitive.
70
71 getNthPps
72
73 $oPpsRoot = oOle->getNthPps($iNth [, $bData]);
74
75 returns PPS as OLE::Storage_Lite::PPS object specified number($iNth).
76 if $bData is true, the objects will have data in the file.
77
78 Asc2Ucs
79
80 $sUcs2 = OLE::Storage_Lite::Asc2Ucs($sAsc);
81
82 Utility function. Just adding 0x00 afeter every characters in $sAsc.
83
84 Ucs2Asc
85
86 $sAsc = OLE::Storage_Lite::Ucs2Asc($sUcs2);
87
88 Utility function. Just deletes 0x00 afeter words in $sUcs.
89
91 OLE::Storage_Lite::PPS has these properties:
92
93 No order number in saving.
94
95 Name
96 its name in UCS2 (a.k.a Unicode).
97
98 Type
99 its type (1:Dir, 2:File (Data), 5: Root)
100
101 PrevPps
102 previous pps (as No)
103
104 NextPps
105 next pps (as No)
106
107 DirPps
108 dir pps (as No).
109
110 Time1st
111 timestamp1st in array ref as similar fomat of localtime.
112
113 Time2nd
114 timestamp2nd in array ref as similar fomat of localtime.
115
116 StartBlock
117 start block number
118
119 Size
120 size of the pps
121
122 Data
123 its data
124
125 Child
126 its child PPSs in array ref
127
129 OLE::Storage_Lite::PPS::Root has 2 methods.
130
131 new
132
133 $oRoot = OLE::Storage_Lite::PPS::Root->new(
134 $raTime1st,
135 $raTime2nd,
136 $raChild);
137
138 Constructor.
139
140 $raTime1st, $raTime2nd is a array ref as ($iSec, $iMin, $iHour, $iDay,
141 $iMon, $iYear, $iHSec). $iSec means seconds, $iMin means minutes.
142 $iHour means hours. $iDay means day. $iMon is month -1. $iYear is year
143 - 1900. $iHSec is seconds/10,000,000 in Math::BigInt.
144
145 $raChild is a array ref of children PPSs.
146
147 save
148
149 $oRoot = $o<oRoot>->save(
150 $sFile,
151 $bNoAs);
152
153 Saves infomations into $sFile. $sFile is '-', this will use STDOUT.
154
155 From 0.06, $sFile may be a scalar reference of file contents (ex.
156 \$sBuff)
157 and IO::Handle object (including IO::File etc).
158
159 if $bNoAs is defined, this function will use the No of PPSs for saving
160 order. if $bNoAs is undefined, this will calculate PPS saving order.
161
163 OLE::Storage_Lite::PPS::Dir has 1 method.
164
165 new
166
167 $oRoot = OLE::Storage_Lite::PPS::Dir->new(
168 $sName
169 [, $raTime1st]
170 [, $raTime2nd]
171 [, $raChild]);
172
173 Constructor.
174
175 $sName is a name of the PPS.
176
177 $raTime1st, $raTime2nd is a array ref as ($iSec, $iMin, $iHour, $iDay,
178 $iMon, $iYear, $iHSec). $iSec means seconds, $iMin means minutes.
179 $iHour means hours. $iDay means day. $iMon is month -1. $iYear is year
180 - 1900. $iHSec is seconds/10,000,000 in Math::BigInt.
181
182 $raChild is a array ref of children PPSs.
183
185 OLE::Storage_Lite::PPS::File has 3 method.
186
187 new
188
189 $oRoot = OLE::Storage_Lite::PPS::File->new($sName, $sData);
190
191 $sName is name of the PPS.
192
193 $sData is data of the PPS.
194
195 newFile
196
197 $oRoot = OLE::Storage_Lite::PPS::File->newFile($sName, $sFile);
198
199 This function makes to use file handle for geting and storing data.
200
201 $sName is name of the PPS.
202
203 If $sFile is scalar, it assumes that is a filename. If $sFile is an
204 IO::Handle object, it uses that specified handle. If $sFile is undef
205 or '', it uses temporary file.
206
207 CAUTION: Take care $sFile will be updated by append method. So if you
208 want to use IO::Handle and append a data to it, you should open the
209 handle with "r+".
210
211 append
212
213 $oRoot = $oPps->append($sData);
214
215 appends specified data to that PPS.
216
217 $sData is appending data for that PPS.
218
220 A saved file with VBA (a.k.a Macros) by this module will not work cor‐
221 rectly. However modules can get the same information from the file,
222 the file occurs a error in application(Word, Excel ...).
223
225 The OLE::Storage_Lite module is Copyright (c) 2000,2001 Kawai Takanori.
226 Japan. All rights reserved.
227
228 You may distribute under the terms of either the GNU General Public
229 License or the Artistic License, as specified in the Perl README file.
230
232 First of all, I would like to acknowledge to Martin Schwartz and his
233 module OLE::Storage.
234
236 Kawai Takanori kwitknr@cpan.org
237
238 Currently maintained by John McNamara jmcnamara@cpan.org
239
241 OLE::Storage
242
243
244
245perl v5.8.8 2004-11-08 Storage_Lite(3)