PHPExcel_Shared_OLE

# Class: PHPExcel_Shared_OLE Source Location: /PHPExcel/Shared/OLE.php
### Class Overview
OLE package base class. #### Author(s): Xavier Noguer <xnoguer@php.net> Christian Schmidt <schmidt@php.net> | ### Variables $bbat $bigBlockSize $root $sbat $smallBlockSize $_file_handle $_list | ### Constants OLE_DATA_SIZE_SMALL OLE_LONG_INT_SIZE OLE_PPS_SIZE OLE_PPS_TYPE_DIR OLE_PPS_TYPE_FILE OLE_PPS_TYPE_ROOT | ### Methods Asc2Ucs getData getDataLength getStream isFile isRoot LocalDate2OLE OLE2LocalDate ppsTotal read _getBlockOffset _ppsTreeComplete _readInt1 _readInt2 _readInt4 _readPpsWks
### Class Details [line 51] OLE package base class. OLE package base class. #### Tags:
author: | Xavier Noguer <xnoguer@php.net>
author: | Christian Schmidt <schmidt@php.net>
[ Top ] ### Class Variables #### $bbat = [line 82] Big Block Allocation Table Big Block Allocation Table #### Tags:
var: | (blockId => nextBlockId)
access: | public
Type: | array
[ Top ] #### $bigBlockSize = [line 94] Size of big blocks. Size of big blocks. This is usually 512. #### Tags:
var: | number of octets per block.
access: | public
Type: | int
[ Top ] #### $root = [line 76] Root directory of OLE container Root directory of OLE container #### Tags:
access: | public
Type: | OLE_PPS_Root
[ Top ] #### $sbat = [line 88] Short Block Allocation Table Short Block Allocation Table #### Tags:
var: | (blockId => nextBlockId)
access: | public
Type: | array
[ Top ] #### $smallBlockSize = [line 100] Size of small blocks. Size of small blocks. This is usually 64. #### Tags:
var: | number of octets per block
access: | public
Type: | int
[ Top ] #### $_file_handle = [line 64] The file handle for reading an OLE container The file handle for reading an OLE container #### Tags:
access: | public
Type: | resource
[ Top ] #### $_list = array() [line 70] Array of PPS's found on the OLE container Array of PPS's found on the OLE container #### Tags:
access: | public
Type: | array
[ Top ] ### Class Methods ### static method Asc2Ucs [line 459]
`static string Asc2Ucs( string $ascii)`
Utility function to transform ASCII text to Unicode Utility function to transform ASCII text to Unicode #### Tags:
return: | The string in Unicode
access: | public
#### Parameters:
string | $ascii | The ASCII string to transform
[ Top ] ### static method LocalDate2OLE [line 477]
`static string LocalDate2OLE( [integer $date = null])`
Utility function Utility function Returns a string for the OLE container with the date given #### Tags:
return: | The string for the OLE container
access: | public
#### Parameters:
integer | $date | A timestamp
[ Top ] ### static method OLE2LocalDate [line 522]
`static string OLE2LocalDate( integer $string)`
Returns a timestamp from an OLE container's date Returns a timestamp from an OLE container's date #### Tags:
return: | The timestamp corresponding to the string
access: | public
#### Parameters:
integer | $string | A binary string with the encoded date
[ Top ] ### method getData [line 423]
`string getData( integer $index, integer $position, integer $length)`
Gets data from a PPS If there is no PPS for the index given, it will return an empty string. Gets data from a PPS If there is no PPS for the index given, it will return an empty string. #### Tags:
return: | The binary string containing the data requested
see: | OLE_PPS_File::getStream()
access: | public
#### Parameters:
integer | $index | The index for the PPS
integer | $position | The position from which to start reading (relative to the PPS)
integer | $length | The amount of bytes to read (at most)
[ Top ] ### method getDataLength [line 443]
`integer getDataLength( integer $index)`
Gets the data length from a PPS If there is no PPS for the index given, it will return 0. Gets the data length from a PPS If there is no PPS for the index given, it will return 0. #### Tags:
return: | The amount of bytes in data the PPS has
access: | public
#### Parameters:
integer | $index | The index for the PPS
[ Top ] ### method getStream [line 210]
`resource getStream( int|PPS $blockIdOrPps)`
Returns a stream for use with fread() etc. use PHPExcel_Shared_OLE_PPS_File::getStream(). Returns a stream for use with fread() etc. External callers should use PHPExcel_Shared_OLE_PPS_File::getStream(). #### Tags:
return: | read-only stream
access: | public
#### Parameters:
int|PPS | $blockIdOrPps | block id or PPS
[ Top ] ### method isFile [line 376]
`bool isFile( integer $index)`
Checks whether a PPS is a File PPS or not. Checks whether a PPS is a File PPS or not. If there is no PPS for the index given, it will return false. #### Tags:
return: | true if it's a File PPS, false otherwise
access: | public
#### Parameters:
integer | $index | The index for the PPS
[ Top ] ### method isRoot [line 392]
`bool isRoot( integer $index)`
Checks whether a PPS is a Root PPS or not. Checks whether a PPS is a Root PPS or not. If there is no PPS for the index given, it will return false. #### Tags:
return: | true if it's a Root PPS, false otherwise
access: | public
#### Parameters:
integer | $index | The index for the PPS.
[ Top ] ### method ppsTotal [line 406]
`integer ppsTotal( )`
Gives the total number of PPS's found in the OLE container. Gives the total number of PPS's found in the OLE container. #### Tags:
return: | The total number of PPS's found in the OLE container
access: | public
[ Top ] ### method read [line 109]
`mixed read( string $file)`
Reads an OLE container from the contents of the file given. Reads an OLE container from the contents of the file given. #### Tags:
return: | true on success, PEAR_Error on failure
access: | public
#### Parameters:
string | $file |
[ Top ] ### method _getBlockOffset [line 199]
`void _getBlockOffset( int $blockId, int 1)`
#### Tags:
access: | public
#### Parameters:
int | 1 | byte offset from beginning of file
int | $blockId | block id
[ Top ] ### method _ppsTreeComplete [line 356]
`boolean _ppsTreeComplete( integer $index)`
It checks whether the PPS tree is complete (all PPS's read) It checks whether the PPS tree is complete (all PPS's read) starting with the given PPS (not necessarily root) #### Tags:
return: | Whether the PPS tree for the given PPS is complete
access: | public
#### Parameters:
integer | $index | The index of the PPS from which we are checking
[ Top ] ### method _readInt1 [line 241]
`int _readInt1( resource $fh)`
Reads a signed char. Reads a signed char. #### Tags:
access: | public
#### Parameters:
resource | $fh | file handle
[ Top ] ### method _readInt2 [line 253]
`int _readInt2( resource $fh)`
Reads an unsigned short (2 octets). Reads an unsigned short (2 octets). #### Tags:
access: | public
#### Parameters:
resource | $fh | file handle
[ Top ] ### method _readInt4 [line 265]
`int _readInt4( resource $fh)`
Reads an unsigned long (4 octets). Reads an unsigned long (4 octets). #### Tags:
access: | public
#### Parameters:
resource | $fh | file handle
[ Top ] ### method _readPpsWks [line 279]
`mixed _readPpsWks( integer $blockId)`
Gets information about all PPS's on the OLE container from the PPS WK's creates an OLE_PPS object for each one. Gets information about all PPS's on the OLE container from the PPS WK's creates an OLE_PPS object for each one. #### Tags:
return: | true on success, PEAR_Error on failure
access: | public
#### Parameters:
integer | $blockId | the block id of the first block
[ Top ] ### Class Constants #### OLE_DATA_SIZE_SMALL = 0x1000 [line 56] [ Top ] #### OLE_LONG_INT_SIZE = 4 [line 57] [ Top ] #### OLE_PPS_SIZE = 0x80 [line 58] [ Top ] #### OLE_PPS_TYPE_DIR = 1 [line 54] [ Top ] #### OLE_PPS_TYPE_FILE = 2 [line 55] [ Top ] #### OLE_PPS_TYPE_ROOT = 5 [line 53] [ Top ] Documentation generated on Mon, 11 Jan 2010 08:12:18 +0100 by phpDocumentor 1.4.1