|
| arrayToBinary ($val) |
| Convert array to binary format and add it to the object table.
|
|
| boolToBinary ($val) |
| Convert a bool value to binary and add it to the object table.
|
|
| dataToBinary ($val) |
| Convert data value to binary format and add it to the object table.
|
|
| dateToBinary ($val) |
| Convert date value (apple format) to binary and adds it to the object table.
|
|
| dictToBinary ($val) |
| Convert dictionary to binary format and add it to the object table.
|
|
| numToBinary ($value) |
| Converts a numeric value to binary and adds it to the object table.
|
|
| parseBinary ($content=null) |
| parse a binary plist string
|
|
| parseBinaryString () |
| Parse a binary plist string.
|
|
| readBinary ($file) |
| Read a binary plist file.
|
|
| readBinaryObject () |
| Read an object type byte, decode it and delegate to the correct reader function.
|
|
| readBinaryObjectAt ($pos) |
| Read an object type byte at position $pos, decode it and delegate to the correct reader function.
|
|
| readBinaryStream ($stream) |
| Read a binary plist stream.
|
|
| stringToBinary ($val) |
| Uniques and transforms a string value to binary format and adds it to the object table.
|
|
| toBinary () |
| Convert CFPropertyList to binary format; since we have to count our objects we simply unique CFDictionary and CFArray.
|
|
| uidToBinary ($value) |
|
|
static | bytesInt ($int) |
| Calculate the byte needed for a „normal” integer value.
|
|
static | bytesNeeded ($count_objects) |
| Calculate the bytes needed to save the number of objects.
|
|
static | bytesSizeInt ($int) |
| calculate the bytes needed for a size integer value
|
|
static | charsetStrlen ($string, $charset="UTF-8") |
| Count characters considering character set Trying to use MBString, Iconv - in that particular order.
|
|
static | convertCharset ($string, $fromCharset, $toCharset='UTF-8') |
| Convert the given string from one charset to another.
|
|
static | intBytes ($int) |
| Code an integer to byte representation.
|
|
static | packItWithSize ($nbytes, $int) |
| „pack” a value (i.e.
|
|
static | typeBytes ($type, $type_len) |
| Code an type byte, consisting of the type marker and the length of the type.
|
|
static | unpackWithSize ($nbytes, $buff) |
| „unpack” multiple values of the specified size (i.e.
|
|
|
static | binaryStrlen ($val) |
| Counts the number of bytes the string will have when coded; utf-16be if non-ascii characters are present.
|
|
static | make64Int ($hi, $lo) |
| Create an 64 bit integer using bcmath or gmp.
|
|
|
string | $content = null |
| Content of the plist (unparsed string)
|
|
integer | $countObjects = 0 |
| Number of objects in file.
|
|
integer | $intSize = 0 |
| The length of all ints in file (byte length)
|
|
integer | $miscSize = 0 |
| The length of misc objects (i.e.
|
|
integer | $objectRefs = 0 |
| Number of object references in file (needed to calculate reference byte length)
|
|
| $objectRefSize = 0 |
| The size of object references.
|
|
| $objectTable = array() |
| Table containing all objects in the file.
|
|
| $offsets = array() |
| The „offsets” (i.e.
|
|
integer | $pos = 0 |
| position in the (unparsed) string
|
|
integer | $stringSize = 0 |
| The length of all strings in the file (byte length, not character length)
|
|
array | $uniqueTable = array() |
| Table containing uniqued objects.
|
|
integer | $writtenObjectCount = 0 |
| Number of objects written during save phase; needed to calculate the size of the object table.
|
|
◆ arrayToBinary()
CFBinaryPropertyList::arrayToBinary |
( |
| $val | ) |
|
Convert array to binary format and add it to the object table.
- Parameters
-
- Return values
-
integer | The position in the object table |
◆ binaryStrlen()
static CFBinaryPropertyList::binaryStrlen |
( |
| $val | ) |
|
|
staticprotected |
Counts the number of bytes the string will have when coded; utf-16be if non-ascii characters are present.
- Parameters
-
string | $val | The string value |
- Return values
-
integer | The length of the coded string in bytes |
◆ boolToBinary()
CFBinaryPropertyList::boolToBinary |
( |
| $val | ) |
|
Convert a bool value to binary and add it to the object table.
- Parameters
-
bool | $val | The boolean value |
- Return values
-
integer | The position in the object table |
◆ bytesInt()
static CFBinaryPropertyList::bytesInt |
( |
| $int | ) |
|
|
static |
Calculate the byte needed for a „normal” integer value.
- Parameters
-
integer | $int | The integer value |
- Return values
-
integer | The number of bytes needed + 1 (because of the „marker byte”) |
◆ bytesNeeded()
static CFBinaryPropertyList::bytesNeeded |
( |
| $count_objects | ) |
|
|
static |
Calculate the bytes needed to save the number of objects.
- Parameters
-
integer | $count_objects | The number of objects |
- Return values
-
integer | The number of bytes |
◆ bytesSizeInt()
static CFBinaryPropertyList::bytesSizeInt |
( |
| $int | ) |
|
|
static |
calculate the bytes needed for a size integer value
- Parameters
-
integer | $int | The integer value to calculate |
- Return values
-
integer | The number of bytes needed |
◆ charsetStrlen()
static CFBinaryPropertyList::charsetStrlen |
( |
| $string, |
|
|
| $charset = "UTF-8" ) |
|
static |
Count characters considering character set Trying to use MBString, Iconv - in that particular order.
- Parameters
-
string | $string | the string to convert |
string | $charset | the charset the given string is currently encoded in |
- Return values
-
integer | The number of characters in that string |
- Exceptions
-
◆ convertCharset()
static CFBinaryPropertyList::convertCharset |
( |
| $string, |
|
|
| $fromCharset, |
|
|
| $toCharset = 'UTF-8' ) |
|
static |
Convert the given string from one charset to another.
Trying to use MBString, Iconv, Recode - in that particular order.
- Parameters
-
string | $string | the string to convert |
string | $fromCharset | the charset the given string is currently encoded in |
string | $toCharset | the charset to convert to, defaults to UTF-8 |
- Return values
-
string | the converted string |
- Exceptions
-
◆ dataToBinary()
CFBinaryPropertyList::dataToBinary |
( |
| $val | ) |
|
Convert data value to binary format and add it to the object table.
- Parameters
-
- Return values
-
integer | The position in the object table |
◆ dateToBinary()
CFBinaryPropertyList::dateToBinary |
( |
| $val | ) |
|
Convert date value (apple format) to binary and adds it to the object table.
- Parameters
-
integer | $value | The date value |
- Return values
-
integer | The position of the coded value in the object table |
◆ dictToBinary()
CFBinaryPropertyList::dictToBinary |
( |
| $val | ) |
|
Convert dictionary to binary format and add it to the object table.
- Parameters
-
- Return values
-
integer | The position in the object table |
◆ intBytes()
static CFBinaryPropertyList::intBytes |
( |
| $int | ) |
|
|
static |
Code an integer to byte representation.
- Parameters
-
integer | $int | The integer value |
- Return values
-
string | The packed byte value |
◆ intToBinary()
CFBinaryPropertyList::intToBinary |
( |
| $value | ) |
|
|
protected |
Codes an integer to binary format.
- Parameters
-
integer | $value | The integer value |
- Return values
-
◆ make64Int()
static CFBinaryPropertyList::make64Int |
( |
| $hi, |
|
|
| $lo ) |
|
staticprotected |
Create an 64 bit integer using bcmath or gmp.
- Parameters
-
int | $hi | The higher word |
int | $lo | The lower word |
- Return values
-
mixed | The integer (as int if possible, as string if not possible) |
- Exceptions
-
◆ numToBinary()
CFBinaryPropertyList::numToBinary |
( |
| $value | ) |
|
Converts a numeric value to binary and adds it to the object table.
- Parameters
-
numeric | $value | The numeric value |
- Return values
-
integer | The position in the object table |
◆ packItWithSize()
static CFBinaryPropertyList::packItWithSize |
( |
| $nbytes, |
|
|
| $int ) |
|
static |
„pack” a value (i.e.
write the binary representation as big endian to a string) with the specified size
- Parameters
-
integer | $nbytes | The number of bytes to pack |
integer | $int | The integer value to pack |
- Return values
-
string | The packed value as string |
◆ parseBinary()
CFBinaryPropertyList::parseBinary |
( |
| $content = null | ) |
|
parse a binary plist string
- Parameters
-
string | $content | The stream to read, defaults to ->content |
- Return values
-
- Exceptions
-
◆ parseBinaryString()
CFBinaryPropertyList::parseBinaryString |
( |
| ) |
|
Parse a binary plist string.
- Return values
-
- Exceptions
-
◆ readBinary()
CFBinaryPropertyList::readBinary |
( |
| $file | ) |
|
Read a binary plist file.
- Parameters
-
string | $file | The file to read |
- Return values
-
- Exceptions
-
◆ readBinaryArray()
CFBinaryPropertyList::readBinaryArray |
( |
| $length | ) |
|
|
protected |
Read an array value, including contained objects.
- Parameters
-
integer | $length | The number of contained objects |
- Return values
-
CFArray | The array value, including the objects |
- Exceptions
-
◆ readBinaryData()
CFBinaryPropertyList::readBinaryData |
( |
| $length | ) |
|
|
protected |
Read a data value.
- Parameters
-
integer | $length | The length (in bytes) of the integer value, coded as „set bit $length to 1” |
- Return values
-
- Exceptions
-
◆ readBinaryDate()
CFBinaryPropertyList::readBinaryDate |
( |
| $length | ) |
|
|
protected |
Read a date value.
- Parameters
-
integer | $length | The length (in bytes) of the integer value, coded as „set bit $length to 1” |
- Return values
-
- Exceptions
-
◆ readBinaryDict()
CFBinaryPropertyList::readBinaryDict |
( |
| $length | ) |
|
|
protected |
Read a dictionary value, including contained objects.
- Parameters
-
integer | $length | The number of contained objects |
- Return values
-
- Exceptions
-
◆ readBinaryInt()
CFBinaryPropertyList::readBinaryInt |
( |
| $length | ) |
|
|
protected |
Read an integer value.
- Parameters
-
integer | $length | The length (in bytes) of the integer value, coded as „set bit $length to 1” |
- Return values
-
- Exceptions
-
◆ readBinaryNullType()
CFBinaryPropertyList::readBinaryNullType |
( |
| $length | ) |
|
|
protected |
Read a „null type” (filler byte, true, false, 0 byte)
- Parameters
-
- Return values
-
- Exceptions
-
◆ readBinaryObject()
CFBinaryPropertyList::readBinaryObject |
( |
| ) |
|
Read an object type byte, decode it and delegate to the correct reader function.
- Return values
-
mixed | The value of the delegate reader, so any of the CFType subclasses |
- Exceptions
-
◆ readBinaryObjectAt()
CFBinaryPropertyList::readBinaryObjectAt |
( |
| $pos | ) |
|
Read an object type byte at position $pos, decode it and delegate to the correct reader function.
- Parameters
-
integer | $pos | The table position in the offsets table |
- Return values
-
mixed | The value of the delegate reader, so any of the CFType subclasses |
◆ readBinaryReal()
CFBinaryPropertyList::readBinaryReal |
( |
| $length | ) |
|
|
protected |
Read a real value.
- Parameters
-
integer | $length | The length (in bytes) of the integer value, coded as „set bit $length to 1” |
- Return values
-
- Exceptions
-
◆ readBinaryStream()
CFBinaryPropertyList::readBinaryStream |
( |
| $stream | ) |
|
Read a binary plist stream.
- Parameters
-
resource | $stream | The stream to read |
- Return values
-
- Exceptions
-
◆ readBinaryString()
CFBinaryPropertyList::readBinaryString |
( |
| $length | ) |
|
|
protected |
Read a string value, usually coded as utf8.
- Parameters
-
integer | $length | The length (in bytes) of the string value |
- Return values
-
- Exceptions
-
◆ readBinaryUnicodeString()
CFBinaryPropertyList::readBinaryUnicodeString |
( |
| $length | ) |
|
|
protected |
Read a unicode string value, coded as UTF-16BE.
- Parameters
-
integer | $length | The length (in bytes) of the string value |
- Return values
-
- Exceptions
-
◆ realToBinary()
CFBinaryPropertyList::realToBinary |
( |
| $val | ) |
|
|
protected |
Codes a real value to binary format.
- Parameters
-
- Return values
-
◆ stringToBinary()
CFBinaryPropertyList::stringToBinary |
( |
| $val | ) |
|
Uniques and transforms a string value to binary format and adds it to the object table.
- Parameters
-
string | $val | The string value |
- Return values
-
integer | The position in the object table |
◆ toBinary()
CFBinaryPropertyList::toBinary |
( |
| ) |
|
◆ typeBytes()
static CFBinaryPropertyList::typeBytes |
( |
| $type, |
|
|
| $type_len ) |
|
static |
Code an type byte, consisting of the type marker and the length of the type.
- Parameters
-
string | $type | The type byte value (i.e. "d" for dictionaries) |
integer | $type_len | The length of the type |
- Return values
-
string | The packed type byte value |
◆ uniqueAndCountValues()
CFBinaryPropertyList::uniqueAndCountValues |
( |
| $value | ) |
|
|
protected |
Count number of objects and create a unique table for strings.
- Parameters
-
$value | The value to count and unique |
- Return values
-
◆ unpackWithSize()
static CFBinaryPropertyList::unpackWithSize |
( |
| $nbytes, |
|
|
| $buff ) |
|
static |
„unpack” multiple values of the specified size (i.e.
get the integers from their binary representation) from a string
- Parameters
-
integer | $nbytes | The number of bytes of each value to unpack |
integer | $buff | The string packed with integer values |
- Return values
-
array | The unpacked integers |
◆ $miscSize
integer CFBinaryPropertyList::$miscSize = 0 |
|
protected |
The length of misc objects (i.e.
not integer and not string) in file
◆ $offsets
CFBinaryPropertyList::$offsets = array() |
|
protected |
The „offsets” (i.e.
the different entries) in the file
The documentation for this class was generated from the following file:
- lib/plist/classes/CFPropertyList/CFBinaryPropertyList.php