OLE package base class.

author | Xavier Noguer
author | Christian Schmidt
category | PHPExcel
package | PHPExcel_Shared_OLE

### Methods

## Utility function to transform ASCII text to Unicode

    Asc2Ucs(string $ascii) : string

Static

access | public
static |

### Parameters

#### $ascii

`string`

The ASCII string to transform

### Returns

`string`The string in Unicode

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

    LocalDate2OLE(integer $date) : string

Static

access | public
static |

### Parameters

#### $date

`integer`

A timestamp

### Returns

`string`The string for the OLE container

## Returns a timestamp from an OLE container's date

    OLE2LocalDate(integer $string) : string

Static

access | public
static |

### Parameters

#### $string

`integer`

A binary string with the encoded date

### Returns

`string`The timestamp corresponding to the string

## _getBlockOffset()

    _getBlockOffset(int $blockId)

access | public

### Parameters

#### $blockId

`int`

block id

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

    _ppsTreeComplete(integer $index) : boolean

access | public

### Parameters

#### $index

`integer`

The index of the PPS from which we are checking

### Returns

`boolean`Whether the PPS tree for the given PPS is complete

## Gets information about all PPS's on the OLE container from the PPS WK's creates an OLE_PPS object for each one.

    _readPpsWks(integer $blockId) : mixed

access | public

### Parameters

#### $blockId

`integer`

the block id of the first block

### Returns

`mixed`true on success, PEAR_Error on failure

## Gets data from a PPS If there is no PPS for the index given, it will return an empty string.

    getData(integer $index, integer $position, integer $length) : string

access | public
see | \OLE_PPS_File::getStream()

### Parameters

#### $index

`integer`

The index for the PPS

#### $position

`integer`

The position from which to start reading (relative to the PPS)

#### $length

`integer`

The amount of bytes to read (at most)

### Returns

`string`The binary string containing the data requested

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

    getDataLength(integer $index) : integer

access | public

### Parameters

#### $index

`integer`

The index for the PPS

### Returns

`integer`The amount of bytes in data the PPS has

## Returns a stream for use with fread() etc.

    getStream(int | \PPS $blockIdOrPps) : resource

External callers should use PHPExcel_Shared_OLE_PPS_File::getStream().

### Parameters

#### $blockIdOrPps

`int``\PPS`

block id or PPS

### Returns

`resource`read-only stream

## Checks whether a PPS is a File PPS or not.

    isFile(integer $index) : bool

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

access | public

### Parameters

#### $index

`integer`

The index for the PPS

### Returns

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

## Checks whether a PPS is a Root PPS or not.

    isRoot(integer $index) : bool

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

access | public

### Parameters

#### $index

`integer`

The index for the PPS.

### Returns

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

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

    ppsTotal() : integer

access | public

### Returns

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

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

    read(string $file) : mixed

acces | public

### Parameters

#### $file

`string`

### Returns

`mixed`true on success, PEAR_Error on failure

## Reads a signed char.

    _readInt1(resource $fh) : int

Static

access | public

### Parameters

#### $fh

`resource`

file handle

### Returns

`int`

## Reads an unsigned short (2 octets).

    _readInt2(resource $fh) : int

Static

access | public

### Parameters

#### $fh

`resource`

file handle

### Returns

`int`

## Reads an unsigned long (4 octets).

    _readInt4(resource $fh) : int

Static

access | public

### Parameters

#### $fh

`resource`

file handle

### Returns

`int`

### Properties

##

    $_file_handle : resource

##

    $_list : array

##

    $bbat : array

##

    $bigBlockSize : int

This is usually 512.

##

    $root : \OLE_PPS_Root

##

    $sbat : array

##

    $smallBlockSize : int

This is usually 64.

### Constants

## OLE_DATA_SIZE_SMALL

    OLE_DATA_SIZE_SMALL

## OLE_LONG_INT_SIZE

    OLE_LONG_INT_SIZE

## OLE_PPS_SIZE

    OLE_PPS_SIZE

## OLE_PPS_TYPE_DIR

    OLE_PPS_TYPE_DIR

## OLE_PPS_TYPE_FILE

    OLE_PPS_TYPE_FILE

## OLE_PPS_TYPE_ROOT

    OLE_PPS_TYPE_ROOT