[ Index ]

PHP Cross Reference of moodle-2.8

title

Body

[close]

/lib/phpexcel/PHPExcel/Reader/ -> Excel5.php (summary)

PHPExcel Copyright (c) 2006 - 2014 PHPExcel

Copyright: Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
License: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
Version: ##VERSION##, ##DATE##
File Size: 7084 lines (237 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

PHPExcel_Reader_Excel5:: (118 methods):
  __construct()
  canRead()
  listWorksheetNames()
  listWorksheetInfo()
  load()
  _readRecordData()
  _loadOLE()
  _readSummaryInformation()
  _readDocumentSummaryInformation()
  _readDefault()
  _readNote()
  _readTextObject()
  _readBof()
  _readFilepass()
  _makeKey()
  _verifyPassword()
  _readCodepage()
  _readDateMode()
  _readFont()
  _readFormat()
  _readXf()
  _readXfExt()
  _readStyle()
  _readPalette()
  _readSheet()
  _readExternalBook()
  _readExternName()
  _readExternSheet()
  _readDefinedName()
  _readMsoDrawingGroup()
  _readSst()
  _readPrintGridlines()
  _readDefaultRowHeight()
  _readSheetPr()
  _readHorizontalPageBreaks()
  _readVerticalPageBreaks()
  _readHeader()
  _readFooter()
  _readHcenter()
  _readVcenter()
  _readLeftMargin()
  _readRightMargin()
  _readTopMargin()
  _readBottomMargin()
  _readPageSetup()
  _readProtect()
  _readScenProtect()
  _readObjectProtect()
  _readPassword()
  _readDefColWidth()
  _readColInfo()
  _readRow()
  _readRk()
  _readLabelSst()
  _readMulRk()
  _readNumber()
  _readFormula()
  _readSharedFmla()
  _readString()
  _readBoolErr()
  _readMulBlank()
  _readLabel()
  _readBlank()
  _readMsoDrawing()
  _readObj()
  _readWindow2()
  _readPageLayoutView()
  _readScl()
  _readPane()
  _readSelection()
  _includeCellRangeFiltered()
  _readMergedCells()
  _readHyperLink()
  _readDataValidations()
  _readDataValidation()
  _readSheetLayout()
  _readSheetProtection()
  _readRangeProtection()
  _readImData()
  _readContinue()
  _getSplicedRecordData()
  _getFormulaFromStructure()
  _getFormulaFromData()
  _createFormulaFromTokens()
  _getNextToken()
  _readBIFF8CellAddress()
  _readBIFF8CellAddressB()
  _readBIFF5CellRangeAddressFixed()
  _readBIFF8CellRangeAddressFixed()
  _readBIFF8CellRangeAddress()
  _readBIFF8CellRangeAddressB()
  _readBIFF8CellRangeAddressList()
  _readBIFF5CellRangeAddressList()
  _readSheetRangeByRefIndex()
  _readBIFF8ConstantArray()
  _readBIFF8Constant()
  _readRGB()
  _readByteStringShort()
  _readByteStringLong()
  _readUnicodeStringShort()
  _readUnicodeStringLong()
  _readUnicodeString()
  _UTF8toExcelDoubleQuoted()
  _extractNumber()
  _GetIEEE754()
  _encodeUTF16()
  _uncompressByteString()
  _decodeCodepage()
  _GetInt2d()
  _GetInt4d()
  _readColor()
  _mapBorderStyle()
  _mapFillPattern()
  _mapErrorCode()
  _mapBuiltInColor()
  _mapColorBIFF5()
  _mapColor()
  _parseRichText()


Class: PHPExcel_Reader_Excel5  - X-Ref

PHPExcel_Reader_Excel5

This class uses {@link http://sourceforge.net/projects/phpexcelreader/parseXL}

__construct()   X-Ref
Create a new PHPExcel_Reader_Excel5 instance


canRead($pFilename)   X-Ref
Can the current PHPExcel_Reader_IReader read the file?

param: string         $pFilename
return: boolean

listWorksheetNames($pFilename)   X-Ref
Reads names of the worksheets from a file, without parsing the whole file to a PHPExcel object

param: string         $pFilename

listWorksheetInfo($pFilename)   X-Ref
Return worksheet info (Name, Last Column Letter, Last Column Index, Total Rows, Total Columns)

param: string     $pFilename

load($pFilename)   X-Ref
Loads PHPExcel from file

param: string         $pFilename
return: PHPExcel

_readRecordData($data, $pos, $len)   X-Ref
Read record data from stream, decrypting as required

param: string $data   Data stream to read from
param: int    $pos    Position to start reading from
param: int    $length Record data length
return: string Record data

_loadOLE($pFilename)   X-Ref
Use OLE reader to extract the relevant data streams from the OLE file

param: string $pFilename

_readSummaryInformation()   X-Ref
Read summary information


_readDocumentSummaryInformation()   X-Ref
Read additional document summary information


_readDefault()   X-Ref
Reads a general type of BIFF record. Does nothing except for moving stream pointer forward to next record.


_readNote()   X-Ref
The NOTE record specifies a comment associated with a particular cell. In Excel 95 (BIFF7) and earlier versions,
this record stores a note (cell note). This feature was significantly enhanced in Excel 97.


_readTextObject()   X-Ref
The TEXT Object record contains the text associated with a cell annotation.


_readBof()   X-Ref
Read BOF


_readFilepass()   X-Ref
FILEPASS

This record is part of the File Protection Block. It
contains information about the read/write password of the
file. All record contents following this record will be
encrypted.

--    "OpenOffice.org's Documentation of the Microsoft
Excel File Format"

The decryption functions and objects used from here on in
are based on the source of Spreadsheet-ParseExcel:
http://search.cpan.org/~jmcnamara/Spreadsheet-ParseExcel/

_makeKey($block, $valContext)   X-Ref
Make an RC4 decryptor for the given block

return: PHPExcel_Reader_Excel5_RC4

_verifyPassword($password, $docid, $salt_data, $hashedsalt_data, &$valContext)   X-Ref
Verify RC4 file password

return: bool Success

_readCodepage()   X-Ref
CODEPAGE

This record stores the text encoding used to write byte
strings, stored as MS Windows code page identifier.

--    "OpenOffice.org's Documentation of the Microsoft
Excel File Format"

_readDateMode()   X-Ref
DATEMODE

This record specifies the base date for displaying date
values. All dates are stored as count of days past this
base date. In BIFF2-BIFF4 this record is part of the
Calculation Settings Block. In BIFF5-BIFF8 it is
stored in the Workbook Globals Substream.

--    "OpenOffice.org's Documentation of the Microsoft
Excel File Format"

_readFont()   X-Ref
Read a FONT record


_readFormat()   X-Ref
FORMAT

This record contains information about a number format.
All FORMAT records occur together in a sequential list.

In BIFF2-BIFF4 other records referencing a FORMAT record
contain a zero-based index into this list. From BIFF5 on
the FORMAT record contains the index itself that will be
used by other records.

--    "OpenOffice.org's Documentation of the Microsoft
Excel File Format"

_readXf()   X-Ref
XF - Extended Format

This record contains formatting information for cells, rows, columns or styles.
According to http://support.microsoft.com/kb/147732 there are always at least 15 cell style XF
and 1 cell XF.
Inspection of Excel files generated by MS Office Excel shows that XF records 0-14 are cell style XF
and XF record 15 is a cell XF
We only read the first cell style XF and skip the remaining cell style XF records
We read all cell XF records.

--    "OpenOffice.org's Documentation of the Microsoft
Excel File Format"

_readXfExt()   X-Ref
No description

_readStyle()   X-Ref
Read STYLE record


_readPalette()   X-Ref
Read PALETTE record


_readSheet()   X-Ref
SHEET

This record is  located in the  Workbook Globals
Substream  and represents a sheet inside the workbook.
One SHEET record is written for each sheet. It stores the
sheet name and a stream offset to the BOF record of the
respective Sheet Substream within the Workbook Stream.

--    "OpenOffice.org's Documentation of the Microsoft
Excel File Format"

_readExternalBook()   X-Ref
Read EXTERNALBOOK record


_readExternName()   X-Ref
Read EXTERNNAME record.


_readExternSheet()   X-Ref
Read EXTERNSHEET record


_readDefinedName()   X-Ref
DEFINEDNAME

This record is part of a Link Table. It contains the name
and the token array of an internal defined name. Token
arrays of defined names contain tokens with aberrant
token classes.

--    "OpenOffice.org's Documentation of the Microsoft
Excel File Format"

_readMsoDrawingGroup()   X-Ref
Read MSODRAWINGGROUP record


_readSst()   X-Ref
SST - Shared String Table

This record contains a list of all strings used anywhere
in the workbook. Each string occurs only once. The
workbook uses indexes into the list to reference the
strings.

--    "OpenOffice.org's Documentation of the Microsoft
Excel File Format"

_readPrintGridlines()   X-Ref
Read PRINTGRIDLINES record


_readDefaultRowHeight()   X-Ref
Read DEFAULTROWHEIGHT record


_readSheetPr()   X-Ref
Read SHEETPR record


_readHorizontalPageBreaks()   X-Ref
Read HORIZONTALPAGEBREAKS record


_readVerticalPageBreaks()   X-Ref
Read VERTICALPAGEBREAKS record


_readHeader()   X-Ref
Read HEADER record


_readFooter()   X-Ref
Read FOOTER record


_readHcenter()   X-Ref
Read HCENTER record


_readVcenter()   X-Ref
Read VCENTER record


_readLeftMargin()   X-Ref
Read LEFTMARGIN record


_readRightMargin()   X-Ref
Read RIGHTMARGIN record


_readTopMargin()   X-Ref
Read TOPMARGIN record


_readBottomMargin()   X-Ref
Read BOTTOMMARGIN record


_readPageSetup()   X-Ref
Read PAGESETUP record


_readProtect()   X-Ref
PROTECT - Sheet protection (BIFF2 through BIFF8)
if this record is omitted, then it also means no sheet protection


_readScenProtect()   X-Ref
SCENPROTECT


_readObjectProtect()   X-Ref
OBJECTPROTECT


_readPassword()   X-Ref
PASSWORD - Sheet protection (hashed) password (BIFF2 through BIFF8)


_readDefColWidth()   X-Ref
Read DEFCOLWIDTH record


_readColInfo()   X-Ref
Read COLINFO record


_readRow()   X-Ref
ROW

This record contains the properties of a single row in a
sheet. Rows and cells in a sheet are divided into blocks
of 32 rows.

--    "OpenOffice.org's Documentation of the Microsoft
Excel File Format"

_readRk()   X-Ref
Read RK record
This record represents a cell that contains an RK value
(encoded integer or floating-point value). If a
floating-point value cannot be encoded to an RK value,
a NUMBER record will be written. This record replaces the
record INTEGER written in BIFF2.

--    "OpenOffice.org's Documentation of the Microsoft
Excel File Format"

_readLabelSst()   X-Ref
Read LABELSST record
This record represents a cell that contains a string. It
replaces the LABEL record and RSTRING record used in
BIFF2-BIFF5.

--    "OpenOffice.org's Documentation of the Microsoft
Excel File Format"

_readMulRk()   X-Ref
Read MULRK record
This record represents a cell range containing RK value
cells. All cells are located in the same row.

--    "OpenOffice.org's Documentation of the Microsoft
Excel File Format"

_readNumber()   X-Ref
Read NUMBER record
This record represents a cell that contains a
floating-point value.

--    "OpenOffice.org's Documentation of the Microsoft
Excel File Format"

_readFormula()   X-Ref
Read FORMULA record + perhaps a following STRING record if formula result is a string
This record contains the token array and the result of a
formula cell.

--    "OpenOffice.org's Documentation of the Microsoft
Excel File Format"

_readSharedFmla()   X-Ref
Read a SHAREDFMLA record. This function just stores the binary shared formula in the reader,
which usually contains relative references.
These will be used to construct the formula in each shared formula part after the sheet is read.


_readString()   X-Ref
Read a STRING record from current stream position and advance the stream pointer to next record
This record is used for storing result from FORMULA record when it is a string, and
it occurs directly after the FORMULA record

return: string The string contents as UTF-8

_readBoolErr()   X-Ref
Read BOOLERR record
This record represents a Boolean value or error value
cell.

--    "OpenOffice.org's Documentation of the Microsoft
Excel File Format"

_readMulBlank()   X-Ref
Read MULBLANK record
This record represents a cell range of empty cells. All
cells are located in the same row

--    "OpenOffice.org's Documentation of the Microsoft
Excel File Format"

_readLabel()   X-Ref
Read LABEL record
This record represents a cell that contains a string. In
BIFF8 it is usually replaced by the LABELSST record.
Excel still uses this record, if it copies unformatted
text cells to the clipboard.

--    "OpenOffice.org's Documentation of the Microsoft
Excel File Format"

_readBlank()   X-Ref
Read BLANK record


_readMsoDrawing()   X-Ref
Read MSODRAWING record


_readObj()   X-Ref
Read OBJ record


_readWindow2()   X-Ref
Read WINDOW2 record


_readPageLayoutView()   X-Ref
Read PLV Record(Created by Excel2007 or upper)


_readScl()   X-Ref
Read SCL record


_readPane()   X-Ref
Read PANE record


_readSelection()   X-Ref
Read SELECTION record. There is one such record for each pane in the sheet.


_includeCellRangeFiltered($cellRangeAddress)   X-Ref
No description

_readMergedCells()   X-Ref
MERGEDCELLS

This record contains the addresses of merged cell ranges
in the current sheet.

--    "OpenOffice.org's Documentation of the Microsoft
Excel File Format"

_readHyperLink()   X-Ref
Read HYPERLINK record


_readDataValidations()   X-Ref
Read DATAVALIDATIONS record


_readDataValidation()   X-Ref
Read DATAVALIDATION record


_readSheetLayout()   X-Ref
Read SHEETLAYOUT record. Stores sheet tab color information.


_readSheetProtection()   X-Ref
Read SHEETPROTECTION record (FEATHEADR)


_readRangeProtection()   X-Ref
Read RANGEPROTECTION record
Reading of this record is based on Microsoft Office Excel 97-2000 Binary File Format Specification,
where it is referred to as FEAT record


_readImData()   X-Ref
Read IMDATA record


_readContinue()   X-Ref
Read a free CONTINUE record. Free CONTINUE record may be a camouflaged MSODRAWING record
When MSODRAWING data on a sheet exceeds 8224 bytes, CONTINUE records are used instead. Undocumented.
In this case, we must treat the CONTINUE record as a MSODRAWING record


_getSplicedRecordData()   X-Ref
Reads a record from current position in data stream and continues reading data as long as CONTINUE
records are found. Splices the record data pieces and returns the combined string as if record data
is in one piece.
Moves to next current position in data stream to start of next record different from a CONtINUE record

return: array

_getFormulaFromStructure($formulaStructure, $baseCell = 'A1')   X-Ref
Convert formula structure into human readable Excel formula like 'A3+A5*5'

param: string $formulaStructure The complete binary data for the formula
param: string $baseCell Base cell, only needed when formula contains tRefN tokens, e.g. with shared formulas
return: string Human readable formula

_getFormulaFromData($formulaData, $additionalData = '', $baseCell = 'A1')   X-Ref
Take formula data and additional data for formula and return human readable formula

param: string $formulaData The binary data for the formula itself
param: string $additionalData Additional binary data going with the formula
param: string $baseCell Base cell, only needed when formula contains tRefN tokens, e.g. with shared formulas
return: string Human readable formula

_createFormulaFromTokens($tokens, $additionalData)   X-Ref
Take array of tokens together with additional data for formula and return human readable formula

param: array $tokens
param: array $additionalData Additional binary data going with the formula
param: string $baseCell Base cell, only needed when formula contains tRefN tokens, e.g. with shared formulas
return: string Human readable formula

_getNextToken($formulaData, $baseCell = 'A1')   X-Ref
Fetch next token from binary formula data

param: string Formula data
param: string $baseCell Base cell, only needed when formula contains tRefN tokens, e.g. with shared formulas
return: array

_readBIFF8CellAddress($cellAddressStructure)   X-Ref
Reads a cell address in BIFF8 e.g. 'A2' or '$A$2'
section 3.3.4

param: string $cellAddressStructure
return: string

_readBIFF8CellAddressB($cellAddressStructure, $baseCell = 'A1')   X-Ref
Reads a cell address in BIFF8 for shared formulas. Uses positive and negative values for row and column
to indicate offsets from a base cell
section 3.3.4

param: string $cellAddressStructure
param: string $baseCell Base cell, only needed when formula contains tRefN tokens, e.g. with shared formulas
return: string

_readBIFF5CellRangeAddressFixed($subData)   X-Ref
Reads a cell range address in BIFF5 e.g. 'A2:B6' or 'A1'
always fixed range
section 2.5.14

param: string $subData
return: string

_readBIFF8CellRangeAddressFixed($subData)   X-Ref
Reads a cell range address in BIFF8 e.g. 'A2:B6' or 'A1'
always fixed range
section 2.5.14

param: string $subData
return: string

_readBIFF8CellRangeAddress($subData)   X-Ref
Reads a cell range address in BIFF8 e.g. 'A2:B6' or '$A$2:$B$6'
there are flags indicating whether column/row index is relative
section 3.3.4

param: string $subData
return: string

_readBIFF8CellRangeAddressB($subData, $baseCell = 'A1')   X-Ref
Reads a cell range address in BIFF8 for shared formulas. Uses positive and negative values for row and column
to indicate offsets from a base cell
section 3.3.4

param: string $subData
param: string $baseCell Base cell
return: string Cell range address

_readBIFF8CellRangeAddressList($subData)   X-Ref
Read BIFF8 cell range address list
section 2.5.15

param: string $subData
return: array

_readBIFF5CellRangeAddressList($subData)   X-Ref
Read BIFF5 cell range address list
section 2.5.15

param: string $subData
return: array

_readSheetRangeByRefIndex($index)   X-Ref
Get a sheet range like Sheet1:Sheet3 from REF index
Note: If there is only one sheet in the range, one gets e.g Sheet1
It can also happen that the REF structure uses the -1 (FFFF) code to indicate deleted sheets,
in which case an PHPExcel_Reader_Exception is thrown

param: int $index
return: string|false

_readBIFF8ConstantArray($arrayData)   X-Ref
read BIFF8 constant value array from array data
returns e.g. array('value' => '{1,2;3,4}', 'size' => 40}
section 2.5.8

param: string $arrayData
return: array

_readBIFF8Constant($valueData)   X-Ref
read BIFF8 constant value which may be 'Empty Value', 'Number', 'String Value', 'Boolean Value', 'Error Value'
section 2.5.7
returns e.g. array('value' => '5', 'size' => 9)

param: string $valueData
return: array

_readRGB($rgb)   X-Ref
Extract RGB color
OpenOffice.org's Documentation of the Microsoft Excel File Format, section 2.5.4

param: string $rgb Encoded RGB value (4 bytes)
return: array

_readByteStringShort($subData)   X-Ref
Read byte string (8-bit string length)
OpenOffice documentation: 2.5.2

param: string $subData
return: array

_readByteStringLong($subData)   X-Ref
Read byte string (16-bit string length)
OpenOffice documentation: 2.5.2

param: string $subData
return: array

_readUnicodeStringShort($subData)   X-Ref
Extracts an Excel Unicode short string (8-bit string length)
OpenOffice documentation: 2.5.3
function will automatically find out where the Unicode string ends.

param: string $subData
return: array

_readUnicodeStringLong($subData)   X-Ref
Extracts an Excel Unicode long string (16-bit string length)
OpenOffice documentation: 2.5.3
this function is under construction, needs to support rich text, and Asian phonetic settings

param: string $subData
return: array

_readUnicodeString($subData, $characterCount)   X-Ref
Read Unicode string with no string length field, but with known character count
this function is under construction, needs to support rich text, and Asian phonetic settings
OpenOffice.org's Documentation of the Microsoft Excel File Format, section 2.5.3

param: string $subData
param: int $characterCount
return: array

_UTF8toExcelDoubleQuoted($value)   X-Ref
Convert UTF-8 string to string surounded by double quotes. Used for explicit string tokens in formulas.
Example:  hello"world  -->  "hello""world"

param: string $value UTF-8 encoded string
return: string

_extractNumber($data)   X-Ref
Reads first 8 bytes of a string and return IEEE 754 float

param: string $data Binary string that is at least 8 bytes long
return: float

_GetIEEE754($rknum)   X-Ref
No description

_encodeUTF16($string, $compressed = '')   X-Ref
Get UTF-8 string from (compressed or uncompressed) UTF-16 string

param: string $string
param: bool $compressed
return: string

_uncompressByteString($string)   X-Ref
Convert UTF-16 string in compressed notation to uncompressed form. Only used for BIFF8.

param: string $string
return: string

_decodeCodepage($string)   X-Ref
Convert string to UTF-8. Only used for BIFF5.

param: string $string
return: string

_GetInt2d($data, $pos)   X-Ref
Read 16-bit unsigned integer

param: string $data
param: int $pos
return: int

_GetInt4d($data, $pos)   X-Ref
Read 32-bit signed integer

param: string $data
param: int $pos
return: int

_readColor($color,$palette,$version)   X-Ref
Read color

param: int $color Indexed color
param: array $palette Color palette
return: array RGB color value, example: array('rgb' => 'FF0000')

_mapBorderStyle($index)   X-Ref
Map border style
OpenOffice documentation: 2.5.11

param: int $index
return: string

_mapFillPattern($index)   X-Ref
Get fill pattern from index
OpenOffice documentation: 2.5.12

param: int $index
return: string

_mapErrorCode($subData)   X-Ref
Map error code, e.g. '#N/A'

param: int $subData
return: string

_mapBuiltInColor($color)   X-Ref
Map built-in color to RGB value

param: int $color Indexed color
return: array

_mapColorBIFF5($subData)   X-Ref
Map color array from BIFF5 built-in color index

param: int $subData
return: array

_mapColor($subData)   X-Ref
Map color array from BIFF8 built-in color index

param: int $subData
return: array

_parseRichText($is = '')   X-Ref
No description



Generated: Fri Nov 28 20:29:05 2014 Cross-referenced by PHPXref 0.7.1