[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/lib/phpexcel/PHPExcel/Shared/ -> String.php (summary)

(no description)

File Size: 819 lines (28 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

PHPExcel_Shared_String:: (31 methods):
  buildControlCharacters()
  buildSYLKCharacters()
  getIsMbstringEnabled()
  getIsIconvEnabled()
  buildCharacterSets()
  ControlCharacterOOXML2PHP()
  ControlCharacterPHP2OOXML()
  SanitizeUTF8()
  IsUTF8()
  FormatNumber()
  UTF8toBIFF8UnicodeShort()
  UTF8toBIFF8UnicodeLong()
  ConvertEncoding()
  utf16_decode()
  CountCharacters()
  Substring()
  StrToUpper()
  StrToLower()
  StrToTitle()
  mb_is_upper()
  mb_str_split()
  StrCaseReverse()
  convertToNumberIfFraction()
  getDecimalSeparator()
  setDecimalSeparator()
  getThousandsSeparator()
  setThousandsSeparator()
  getCurrencyCode()
  setCurrencyCode()
  SYLKtoUTF8()
  testStringAsNumeric()


Class: PHPExcel_Shared_String  - X-Ref

PHPExcel_Shared_String

Copyright (c) 2006 - 2015 PHPExcel

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA

buildControlCharacters()   X-Ref
Build control characters array


buildSYLKCharacters()   X-Ref
Build SYLK characters array


getIsMbstringEnabled()   X-Ref
Get whether mbstring extension is available

return: boolean

getIsIconvEnabled()   X-Ref
Get whether iconv extension is available

return: boolean

buildCharacterSets()   X-Ref
No description

ControlCharacterOOXML2PHP($value = '')   X-Ref
Convert from OpenXML escaped control character to PHP control character

Excel 2007 team:
----------------
That's correct, control characters are stored directly in the shared-strings table.
We do encode characters that cannot be represented in XML using the following escape sequence:
_xHHHH_ where H represents a hexadecimal character in the character's value...
So you could end up with something like _x0008_ in a string (either in a cell value (<v>)
element or in the shared string <t> element.

param: string    $value    Value to unescape
return: string

ControlCharacterPHP2OOXML($value = '')   X-Ref
Convert from PHP control character to OpenXML escaped control character

Excel 2007 team:
----------------
That's correct, control characters are stored directly in the shared-strings table.
We do encode characters that cannot be represented in XML using the following escape sequence:
_xHHHH_ where H represents a hexadecimal character in the character's value...
So you could end up with something like _x0008_ in a string (either in a cell value (<v>)
element or in the shared string <t> element.

param: string    $value    Value to escape
return: string

SanitizeUTF8($value)   X-Ref
Try to sanitize UTF8, stripping invalid byte sequences. Not perfect. Does not surrogate characters.

param: string $value
return: string

IsUTF8($value = '')   X-Ref
Check if a string contains UTF8 data

param: string $value
return: boolean

FormatNumber($value)   X-Ref
Formats a numeric value as a string for output in various output writers forcing
point as decimal separator in case locale is other than English.

param: mixed $value
return: string

UTF8toBIFF8UnicodeShort($value, $arrcRuns = array()   X-Ref
Converts a UTF-8 string into BIFF8 Unicode string data (8-bit string length)
Writes the string using uncompressed notation, no rich text, no Asian phonetics
If mbstring extension is not available, ASCII is assumed, and compressed notation is used
although this will give wrong results for non-ASCII strings
see OpenOffice.org's Documentation of the Microsoft Excel File Format, sect. 2.5.3

param: string  $value    UTF-8 encoded string
param: mixed[] $arrcRuns Details of rich text runs in $value
return: string

UTF8toBIFF8UnicodeLong($value)   X-Ref
Converts a UTF-8 string into BIFF8 Unicode string data (16-bit string length)
Writes the string using uncompressed notation, no rich text, no Asian phonetics
If mbstring extension is not available, ASCII is assumed, and compressed notation is used
although this will give wrong results for non-ASCII strings
see OpenOffice.org's Documentation of the Microsoft Excel File Format, sect. 2.5.3

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

ConvertEncoding($value, $to, $from)   X-Ref
Convert string from one encoding to another. First try mbstring, then iconv, finally strlen

param: string $value
param: string $to Encoding to convert to, e.g. 'UTF-8'
param: string $from Encoding to convert from, e.g. 'UTF-16LE'
return: string

utf16_decode($str, $bom_be = true)   X-Ref
Decode UTF-16 encoded strings.

Can handle both BOM'ed data and un-BOM'ed data.
Assumes Big-Endian byte order if no BOM is available.
This function was taken from http://php.net/manual/en/function.utf8-decode.php
and $bom_be parameter added.

param: string  $str  UTF-16 encoded data to decode.
return: string  UTF-8 / ISO encoded data.
author: Rasmus Andersson {@link http://rasmusandersson.se/}
author: vadik56

CountCharacters($value, $enc = 'UTF-8')   X-Ref
Get character count. First try mbstring, then iconv, finally strlen

param: string $value
param: string $enc Encoding
return: int Character count

Substring($pValue = '', $pStart = 0, $pLength = 0)   X-Ref
Get a substring of a UTF-8 encoded string. First try mbstring, then iconv, finally strlen

param: string $pValue UTF-8 encoded string
param: int $pStart Start offset
param: int $pLength Maximum number of characters in substring
return: string

StrToUpper($pValue = '')   X-Ref
Convert a UTF-8 encoded string to upper case

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

StrToLower($pValue = '')   X-Ref
Convert a UTF-8 encoded string to lower case

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

StrToTitle($pValue = '')   X-Ref
Convert a UTF-8 encoded string to title/proper case
(uppercase every first character in each word, lower case all other characters)

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

mb_is_upper($char)   X-Ref
No description

mb_str_split($string)   X-Ref
No description

StrCaseReverse($pValue = '')   X-Ref
Reverse the case of a string, so that all uppercase characters become lowercase
and all lowercase characters become uppercase

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

convertToNumberIfFraction(&$operand)   X-Ref
Identify whether a string contains a fractional numeric value,
and convert it to a numeric if it is

param: string &$operand string value to test
return: boolean

getDecimalSeparator()   X-Ref
Get the decimal separator. If it has not yet been set explicitly, try to obtain number
formatting information from locale.

return: string

setDecimalSeparator($pValue = '.')   X-Ref
Set the decimal separator. Only used by PHPExcel_Style_NumberFormat::toFormattedString()
to format output by PHPExcel_Writer_HTML and PHPExcel_Writer_PDF

param: string $pValue Character for decimal separator

getThousandsSeparator()   X-Ref
Get the thousands separator. If it has not yet been set explicitly, try to obtain number
formatting information from locale.

return: string

setThousandsSeparator($pValue = ',')   X-Ref
Set the thousands separator. Only used by PHPExcel_Style_NumberFormat::toFormattedString()
to format output by PHPExcel_Writer_HTML and PHPExcel_Writer_PDF

param: string $pValue Character for thousands separator

getCurrencyCode()   X-Ref
Get the currency code. If it has not yet been set explicitly, try to obtain the
symbol information from locale.

return: string

setCurrencyCode($pValue = '$')   X-Ref
Set the currency code. Only used by PHPExcel_Style_NumberFormat::toFormattedString()
to format output by PHPExcel_Writer_HTML and PHPExcel_Writer_PDF

param: string $pValue Character for currency code

SYLKtoUTF8($pValue = '')   X-Ref
Convert SYLK encoded string to UTF-8

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

testStringAsNumeric($value)   X-Ref
Retrieve any leading numeric part of a string, or return the full string if no leading numeric
(handles basic integer or float, but not exponent or non decimal)

param: string    $value
return: mixed    string or only the leading numeric part of the string



Generated: Thu Aug 11 10:00:09 2016 Cross-referenced by PHPXref 0.7.1