Overview

Packages

  • JAMA
  • None
  • PHP
  • PHPExcel
    • CachedObjectStorage
    • Calculation
    • Cell
    • Chart
      • Renderer
    • Reader
      • Excel2007
      • Excel5
    • RichText
    • Settings
    • Shared
      • Escher
      • OLE
      • Trend
      • ZipArchive
    • Style
    • Worksheet
      • Drawing
    • Writer
      • 2007
      • CSV
      • Excel2007
      • Excel5
      • HTML
      • PDF

Classes

  • PHPExcel_Shared_OLE
  • PHPExcel_Shared_OLE_ChainedBlockStream
  • PHPExcel_Shared_OLE_PPS
  • PHPExcel_Shared_OLE_PPS_File
  • PHPExcel_Shared_OLE_PPS_Root
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated
  • Todo
  • Download

Class PHPExcel_Shared_OLE

OLE package base class.

Package: PHPExcel\Shared\OLE
Category: PHPExcel
Author: Xavier Noguer xnoguer@php.net
Author: Christian Schmidt schmidt@php.net
Located at controlador/include/phpexcel/PHPExcel/Shared/OLE.php
Methods summary
public 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.

Parameters

$file

Returns

mixed
true on success, PEAR_Error on failure

Acces

public
public
# _getBlockOffset( integer $blockId )

Parameters

$blockId
id
public resource
# getStream( integer|PPS $blockIdOrPps )

Returns a stream for use with fread() etc. External callers should 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().

Parameters

$blockIdOrPps
id or PPS

Returns

resource
read-only stream
private static integer
# _readInt1( resource $fh )

Reads a signed char.

Reads a signed char.

Parameters

$fh
handle

Returns

integer
private static integer
# _readInt2( resource $fh )

Reads an unsigned short (2 octets).

Reads an unsigned short (2 octets).

Parameters

$fh
handle

Returns

integer
private static integer
# _readInt4( resource $fh )

Reads an unsigned long (4 octets).

Reads an unsigned long (4 octets).

Parameters

$fh
handle

Returns

integer
public 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.

Parameters

$blockId
block id of the first block

Returns

mixed
true on success, PEAR_Error on failure
public boolean
# _ppsTreeComplete( integer $index )

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

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

Parameters

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

Returns

boolean
Whether the PPS tree for the given PPS is complete
public boolean
# 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.

Checks whether a PPS is a File PPS or not. If there is no PPS for the index given, it will return false.

Parameters

$index
The index for the PPS

Returns

boolean
true if it's a File PPS, false otherwise
public boolean
# 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.

Checks whether a PPS is a Root PPS or not. If there is no PPS for the index given, it will return false.

Parameters

$index
The index for the PPS.

Returns

boolean
true if it's a Root PPS, false otherwise
public 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.

Returns

integer
The total number of PPS's found in the OLE container
public 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.

Parameters

$index
The index for the PPS
$position

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

$length
The amount of bytes to read (at most)

Returns

string
The binary string containing the data requested

See

OLE_PPS_File::getStream()
public 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.

Parameters

$index
The index for the PPS

Returns

integer
The amount of bytes in data the PPS has
public static string
# Asc2Ucs( string $ascii )

Utility function to transform ASCII text to Unicode

Utility function to transform ASCII text to Unicode

Parameters

$ascii
The ASCII string to transform

Returns

string
The string in Unicode
public static string
# LocalDate2OLE( integer $date = null )

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

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

Parameters

$date
A timestamp

Returns

string
The string for the OLE container
public static string
# OLE2LocalDate( integer $string )

Returns a timestamp from an OLE container's date

Returns a timestamp from an OLE container's date

Parameters

$string
A binary string with the encoded date

Returns

string
The timestamp corresponding to the string
Constants summary
integer OLE_PPS_TYPE_ROOT
# 5
integer OLE_PPS_TYPE_DIR
# 1
integer OLE_PPS_TYPE_FILE
# 2
integer OLE_DATA_SIZE_SMALL
# 0x1000
integer OLE_LONG_INT_SIZE
# 4
integer OLE_PPS_SIZE
# 0x80
Properties summary
public resource $_file_handle

The file handle for reading an OLE container

The file handle for reading an OLE container

#
public array $_list

Array of PPS's found on the OLE container

Array of PPS's found on the OLE container

# array()
public OLE_PPS_Root $root

Root directory of OLE container

Root directory of OLE container

#
public array $bbat

Big Block Allocation Table

Big Block Allocation Table

#
public array $sbat

Short Block Allocation Table

Short Block Allocation Table

#
public integer $bigBlockSize

Size of big blocks. This is usually 512.

Size of big blocks. This is usually 512.

#
public integer $smallBlockSize

Size of small blocks. This is usually 64.

Size of small blocks. This is usually 64.

#
Autene API documentation generated by ApiGen