class PHPExcel_Shared_OLE

OLE package base class.

Constants

OLE_PPS_TYPE_ROOT

OLE_PPS_TYPE_DIR

OLE_PPS_TYPE_FILE

OLE_DATA_SIZE_SMALL

OLE_LONG_INT_SIZE

OLE_PPS_SIZE

Properties

resource $_file_handle The file handle for reading an OLE container
array $_list Array of PPS's found on the OLE container
OLE_PPS_Root $root Root directory of OLE container
array $bbat Big Block Allocation Table
array $sbat Short Block Allocation Table
int $bigBlockSize Size of big blocks. This is usually 512.
int $smallBlockSize Size of small blocks. This is usually 64.

Methods

mixed
read(string $file)

Reads an OLE container from the contents of the file given.

_getBlockOffset($blockId)

No description

resource
getStream(int|PPS $blockIdOrPps)

Returns a stream for use with fread() etc. External callers should use PHPExcelSharedOLEPPSFile::getStream().

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.

boolean
_ppsTreeComplete(integer $index)

It checks whether the PPS tree is complete (all PPS's read) starting with the given PPS (not necessarily root)

bool
isFile(integer $index)

Checks whether a PPS is a File PPS or not.

bool
isRoot(integer $index)

Checks whether a PPS is a Root PPS or not.

integer
ppsTotal()

Gives the total number of PPS's found in the OLE container.

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.

integer
getDataLength(integer $index)

Gets the data length from a PPS If there is no PPS for the index given, it will return 0.

static string
Asc2Ucs(string $ascii)

Utility function to transform ASCII text to Unicode

static string
LocalDate2OLE(integer $date = null)

Utility function Returns a string for the OLE container with the date given

static string
OLE2LocalDate(integer $string)

Returns a timestamp from an OLE container's date

Details

at line 105
mixed read(string $file)

Reads an OLE container from the contents of the file given.

Parameters

string $file

Return Value

mixed true on success, PEAR_Error on failure

at line 195
_getBlockOffset($blockId)

Parameters

$blockId

at line 206
resource getStream(int|PPS $blockIdOrPps)

Returns a stream for use with fread() etc. External callers should use PHPExcelSharedOLEPPSFile::getStream().

Parameters

int|PPS $blockIdOrPps block id or PPS

Return Value

resource read-only stream

at line 274
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.

Parameters

integer $blockId the block id of the first block

Return Value

mixed true on success, PEAR_Error on failure

at line 348
boolean _ppsTreeComplete(integer $index)

It checks whether the PPS tree is complete (all PPS's read) starting with the given PPS (not necessarily root)

Parameters

integer $index The index of the PPS from which we are checking

Return Value

boolean Whether the PPS tree for the given PPS is complete

at line 368
bool isFile(integer $index)

Checks whether a PPS is a File PPS or not.

If there is no PPS for the index given, it will return false.

Parameters

integer $index The index for the PPS

Return Value

bool true if it's a File PPS, false otherwise

at line 384
bool isRoot(integer $index)

Checks whether a PPS is a Root PPS or not.

If there is no PPS for the index given, it will return false.

Parameters

integer $index The index for the PPS.

Return Value

bool true if it's a Root PPS, false otherwise

at line 398
integer ppsTotal()

Gives the total number of PPS's found in the OLE container.

Return Value

integer The total number of PPS's found in the OLE container

at line 415
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.

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)

Return Value

string The binary string containing the data requested

See also

OLE_PPS_File::getStream()

at line 435
integer getDataLength(integer $index)

Gets the data length from a PPS If there is no PPS for the index given, it will return 0.

Parameters

integer $index The index for the PPS

Return Value

integer The amount of bytes in data the PPS has

at line 451
static string Asc2Ucs(string $ascii)

Utility function to transform ASCII text to Unicode

Parameters

string $ascii The ASCII string to transform

Return Value

string The string in Unicode

at line 469
static string LocalDate2OLE(integer $date = null)

Utility function Returns a string for the OLE container with the date given

Parameters

integer $date A timestamp

Return Value

string The string for the OLE container

at line 513
static string OLE2LocalDate(integer $string)

Returns a timestamp from an OLE container's date

Parameters

integer $string A binary string with the encoded date

Return Value

string The timestamp corresponding to the string