1OLE::Storage_Lite(3) User Contributed Perl Documentation OLE::Storage_Lite(3)
2
3
4
6 OLE::Storage_Lite - Simple Class for OLE document interface.
7
9 use OLE::Storage_Lite;
10
11 # Initialize.
12
13 # From a file
14 my $oOl = OLE::Storage_Lite->new("some.xls");
15
16 # From a filehandle 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
23 # Read data
24 my $oPps = $oOl->getPpsTree(1);
25
26 # Save Data
27 # To a File
28 $oPps->save("kaba.xls"); #kaba.xls
29 $oPps->save('-'); #STDOUT
30
31 # To a filehandle object
32 my $oIo = new IO::File;
33 $oIo->open(">iofile.xls");
34 bimode($oIo);
35 $oPps->save($oIo);
36
38 OLE::Storage_Lite allows you to read and write an OLE structured file.
39
40 OLE::Storage_Lite::PPS is a class representing PPS.
41 OLE::Storage_Lite::PPS::Root, OLE::Storage_Lite::PPS::File and
42 OLE::Storage_Lite::PPS::Dir are subclasses of OLE::Storage_Lite::PPS.
43
44 new()
45 Constructor.
46
47 $oOle = OLE::Storage_Lite->new($sFile);
48
49 Creates a OLE::Storage_Lite object for $sFile. $sFile must be a correct
50 file name.
51
52 The "new()" constructor also accepts a valid filehandle. Remember to
53 "binmode()" the filehandle first.
54
55 getPpsTree()
56 $oPpsRoot = $oOle->getPpsTree([$bData]);
57
58 Returns PPS as an OLE::Storage_Lite::PPS::Root object. Other PPS
59 objects will be included as its children.
60
61 If $bData is true, the objects will have data in the file.
62
63 getPpsSearch()
64 $oPpsRoot = $oOle->getPpsTree($raName [, $bData][, $iCase] );
65
66 Returns PPSs as OLE::Storage_Lite::PPS objects that has the name
67 specified in $raName array.
68
69 If $bData is true, the objects will have data in the file. If $iCase
70 is true, search is case insensitive.
71
72 getNthPps()
73 $oPpsRoot = $oOle->getNthPps($iNth [, $bData]);
74
75 Returns PPS as "OLE::Storage_Lite::PPS" object specified number $iNth.
76
77 If $bData is true, the objects will have data in the file.
78
79 Asc2Ucs()
80 $sUcs2 = OLE::Storage_Lite::Asc2Ucs($sAsc>);
81
82 Utility function. Just adds 0x00 after every characters in $sAsc.
83
84 Ucs2Asc()
85 $sAsc = OLE::Storage_Lite::Ucs2Asc($sUcs2);
86
87 Utility function. Just deletes 0x00 after words in $sUcs.
88
90 OLE::Storage_Lite::PPS has these properties:
91
92 No Order number in saving.
93
94 Name
95 Its name in UCS2 (a.k.a Unicode).
96
97 Type
98 Its type (1:Dir, 2:File (Data), 5: Root)
99
100 PrevPps
101 Previous pps (as No)
102
103 NextPps
104 Next pps (as No)
105
106 DirPps
107 Dir pps (as No).
108
109 Time1st
110 Timestamp 1st in array ref as similar format of localtime.
111
112 Time2nd
113 Timestamp 2nd in array ref as similar format of localtime.
114
115 StartBlock
116 Start block number
117
118 Size
119 Size of the pps
120
121 Data
122 Its data
123
124 Child
125 Its child PPSs in array ref
126
128 OLE::Storage_Lite::PPS::Root has 2 methods.
129
130 new()
131 $oRoot = OLE::Storage_Lite::PPS::Root->new(
132 $raTime1st,
133 $raTime2nd,
134 $raChild);
135
136 Constructor.
137
138 $raTime1st, $raTime2nd are array refs with ($iSec, $iMin, $iHour,
139 $iDay, $iMon, $iYear). $iSec means seconds, $iMin means minutes.
140 $iHour means hours. $iDay means day. $iMon is month -1. $iYear is year
141 - 1900.
142
143 $raChild is a array ref of children PPSs.
144
145 save()
146 $oRoot = $oRoot>->save(
147 $sFile,
148 $bNoAs);
149
150 Saves information into $sFile. If $sFile is '-', this will use STDOUT.
151
152 The "new()" constructor also accepts a valid filehandle. Remember to
153 "binmode()" the filehandle first.
154
155 If $bNoAs is defined, this function will use the No of PPSs for saving
156 order. If $bNoAs is undefined, this will calculate PPS saving order.
157
159 OLE::Storage_Lite::PPS::Dir has 1 method.
160
161 new()
162 $oRoot = OLE::Storage_Lite::PPS::Dir->new(
163 $sName,
164 [, $raTime1st]
165 [, $raTime2nd]
166 [, $raChild>]);
167
168 Constructor.
169
170 $sName is a name of the PPS.
171
172 $raTime1st, $raTime2nd is a array ref as ($iSec, $iMin, $iHour, $iDay,
173 $iMon, $iYear). $iSec means seconds, $iMin means minutes. $iHour means
174 hours. $iDay means day. $iMon is month -1. $iYear is year - 1900.
175
176 $raChild is a array ref of children PPSs.
177
179 OLE::Storage_Lite::PPS::File has 3 method.
180
181 new
182 $oRoot = OLE::Storage_Lite::PPS::File->new($sName, $sData);
183
184 $sName is name of the PPS.
185
186 $sData is data of the PPS.
187
188 newFile()
189 $oRoot = OLE::Storage_Lite::PPS::File->newFile($sName, $sFile);
190
191 This function makes to use file handle for getting and storing data.
192
193 $sName is name of the PPS.
194
195 If $sFile is scalar, it assumes that is a filename. If $sFile is an
196 IO::Handle object, it uses that specified handle. If $sFile is undef
197 or '', it uses temporary file.
198
199 CAUTION: Take care $sFile will be updated by "append" method. So if
200 you want to use IO::Handle and append a data to it, you should open the
201 handle with "r+".
202
203 append()
204 $oRoot = $oPps->append($sData);
205
206 appends specified data to that PPS.
207
208 $sData is appending data for that PPS.
209
211 A saved file with VBA (a.k.a Macros) by this module will not work
212 correctly. However modules can get the same information from the file,
213 the file occurs a error in application(Word, Excel ...).
214
216 Older version of "OLE::Storage_Lite" autovivified a scalar ref in the
217 "new()" constructors into a scalar filehandle. This functionality is
218 still there for backwards compatibility but it is highly recommended
219 that you do not use it. Instead create a filehandle (scalar or
220 otherwise) and pass that in.
221
223 The OLE::Storage_Lite module is Copyright (c) 2000,2001 Kawai Takanori.
224 Japan. All rights reserved.
225
226 You may distribute under the terms of either the GNU General Public
227 License or the Artistic License, as specified in the Perl README file.
228
230 First of all, I would like to acknowledge to Martin Schwartz and his
231 module OLE::Storage.
232
234 Kawai Takanori kwitknr@cpan.org
235
236 This module is currently maintained by John McNamara jmcnamara@cpan.org
237
239 OLE::Storage
240
241 Documentation for the OLE Compound document has been released by
242 Microsoft under the Open Specification Promise. See
243 http://www.microsoft.com/interop/docs/supportingtechnologies.mspx
244
245 The Digital Imaging Group have also detailed the OLE format in the
246 JPEG2000 specification: see Appendix A of
247 http://www.i3a.org/pdf/wg1n1017.pdf
248
249
250
251perl v5.30.1 2020-01-30 OLE::Storage_Lite(3)