Class CFPropertyList

Description

Implements interfaces:

  • Iterator (internal interface)

Property List Interface for handling reading, editing and saving Property Lists as defined by Apple.

Located in /CFPropertyList.php (line 41)

CFBinaryPropertyList
   |
   --CFPropertyList
Class Constant Summary
Variable Summary
static array $types
string $file
integer $format
array $value
Method Summary
static CFType guess (mixed $value, [boolean $autoDictionary = false])
void add ([CFType $value = null])
CFType del (integer $key)
CFPropertyList __construct ([string $file = null], [integer $format = self::FORMAT_AUTO])
CFType get (integer $key)
CFType|array getValue ([string $cftype = false])
void import ( $node, CFDictionary|CFArray|CFPropertyList $parent)
string key ()
void load ([string $file = null], [integer $format = null])
void loadBinary ([string $file = null])
void loadXML ([string $file = null])
void next ()
void rewind ()
void save ([string $file = null], [string $format = null])
void saveBinary (string $file)
void saveXML (string $file)
mixed toArray ()
string toXML ([bool $formatted = false])
boolean valid ()
CFType __get (integer $key)
Variables
static array $types = array(
'string' => 'CFString',
'real' => 'CFNumber',
'integer' => 'CFNumber',
'date' => 'CFDate',
'true' => 'CFBoolean',
'false' => 'CFBoolean',
'data' => 'CFData',
'array' => 'CFArray',
'dict' => 'CFDictionary'
)
(line 94)

List of NodeNames to ClassNames for resolving plist-files

  • access: protected
string $file = null (line 64)

Path of PropertyList

integer $format = null (line 70)

Path of PropertyList

array $iteratorKeys = null (line 88)

List of Keys for numerical iterator access http://php.net/manual/en/class.iterator.php

integer $iteratorPosition = 0 (line 82)

Position of iterator http://php.net/manual/en/class.iterator.php

array $value = array() (line 76)

CFType nodes

Inherited Variables

Inherited from CFBinaryPropertyList

CFBinaryPropertyList::$countObjects
CFBinaryPropertyList::$intSize
CFBinaryPropertyList::$miscSize
CFBinaryPropertyList::$objectRefs
CFBinaryPropertyList::$objectRefSize
CFBinaryPropertyList::$objectTable
CFBinaryPropertyList::$offsets
CFBinaryPropertyList::$stringSize
CFBinaryPropertyList::$uniqueTable
CFBinaryPropertyList::$writtenObjectCount
Methods
static method guess (line 415)

Create CFType-structure from guessing the data-types.

The functionality has been moved to the more flexible CFTypeDetector facility.

  • return: CFType based on guessed type
  • deprecated:
  • access: public
  • uses: CFTypeDetector - for actual type detection
static CFType guess (mixed $value, [boolean $autoDictionary = false])
  • mixed $value: Value to convert to CFType
  • boolean $autoDictionary: if true CFArray-detection is bypassed and arrays will be returned as CFDictionary.
add (line 343)

Add CFType to collection.

void add ([CFType $value = null])
  • CFType $value: CFType to add to collection
current (line 465)

Get Iterator's current CFType identified by $iteratorPosition

CFType current ()

Implementation of:
Iterator::current
del (line 380)

Remove CFType from collection.

CFType del (integer $key)
  • integer $key: Key of CFType to removes from collection
Constructor __construct (line 116)

Create new CFPropertyList.

If a path to a PropertyList is specified, it is loaded automatically.

CFPropertyList __construct ([string $file = null], [integer $format = self::FORMAT_AUTO])
get (line 357)

Get CFType from collection.

  • return: CFType found at $key, null else
  • access: public
  • uses: CFPropertyList::$value - for retrieving CFType of $key
CFType get (integer $key)
  • integer $key: Key of CFType to retrieve from collection
getValue (line 396)

Get first (and only) child, or complete collection.

  • return: CFType or list of CFTypes known to the PropertyList
  • access: public
  • uses: CFPropertyList::$value - for retrieving CFTypes
CFType|array getValue ([string $cftype = false])
  • string $cftype: if set to true returned value will be CFArray instead of an array in case of a collection
import (line 199)

Convert a DOMNode into a CFType.

void import ( $node, CFDictionary|CFArray|CFPropertyList $parent)
key (line 476)

Get Iterator's current key identified by $iteratorPosition

string key ()

Implementation of:
Iterator::key
load (line 159)

Load a plist file.

Load and import a plist file.

void load ([string $file = null], [integer $format = null])
loadBinary (line 142)

Load an binary PropertyList.

  • throws: PListException if binary plist-file could not be read properly
  • throws: IOException if file could not be read
  • access: public
  • uses: CFPropertyList::load() - to actually load the file
void loadBinary ([string $file = null])
  • string $file: Path of PropertyList, defaults to $file
loadXML (line 130)

Load an XML PropertyList.

  • throws: DOMException if XML-file could not be read properly
  • throws: IOException if file could not be read
  • access: public
  • uses: CFPropertyList::load() - to actually load the file
void loadXML ([string $file = null])
  • string $file: Path of PropertyList, defaults to $file
next (line 486)

Increment $iteratorPosition to address next {@see CFType}

void next ()

Implementation of:
Iterator::next
rewind (line 453)

Rewind $iteratorPosition to first position (being 0)

void rewind ()

Implementation of:
Iterator::rewind
save (line 284)

Convert CFPropertyList to XML or binary and save to file.

void save ([string $file = null], [string $format = null])
  • string $file: Path of PropertyList, defaults to $file
  • string $format: Format of PropertyList, defaults to $format
saveBinary (line 270)

Convert CFPropertyList to binary format (bplist00) and save to file.

  • throws: IOException if file could not be read
  • access: public
  • uses: CFPropertyList::$file - if $file was not specified
void saveBinary (string $file)
  • string $file: Path of PropertyList, defaults to $file
saveXML (line 259)

Convert CFPropertyList to XML and save to file.

  • throws: IOException if file could not be read
  • access: public
  • uses: CFPropertyList::$file - if $file was not specified
void saveXML (string $file)
  • string $file: Path of PropertyList, defaults to $file
toArray (line 433)

Get PropertyList as array.

  • return: primitive value of first (and only) CFType, or array of primitive values of collection
  • access: public
  • uses: CFPropertyList::$value - for retrieving CFTypes
mixed toArray ()
toXML (line 309)

Convert CFPropertyList to XML

  • return: The XML content
  • access: public
string toXML ([bool $formatted = false])
  • bool $formatted: Print plist formatted (i.e. with newlines and whitespace indention) if true; defaults to false
valid (line 497)

Test if $iteratorPosition addresses a valid element of $value

boolean valid ()

Implementation of:
Iterator::valid
__get (line 370)

Generic getter (magic)

CFType __get (integer $key)
  • integer $key: Key of CFType to retrieve from collection

Inherited Methods

Inherited From CFBinaryPropertyList

CFBinaryPropertyList::arrayToBinary()
CFBinaryPropertyList::binaryStrlen()
CFBinaryPropertyList::boolToBinary()
CFBinaryPropertyList::bytesInt()
CFBinaryPropertyList::bytesNeeded()
CFBinaryPropertyList::bytesSizeInt()
CFBinaryPropertyList::charsetStrlen()
CFBinaryPropertyList::convertCharset()
CFBinaryPropertyList::dataToBinary()
CFBinaryPropertyList::dateToBinary()
CFBinaryPropertyList::dictToBinary()
CFBinaryPropertyList::intBytes()
CFBinaryPropertyList::intToBinary()
CFBinaryPropertyList::make64Int()
CFBinaryPropertyList::numToBinary()
CFBinaryPropertyList::packItWithSize()
CFBinaryPropertyList::readBinary()
CFBinaryPropertyList::readBinaryArray()
CFBinaryPropertyList::readBinaryData()
CFBinaryPropertyList::readBinaryDate()
CFBinaryPropertyList::readBinaryDict()
CFBinaryPropertyList::readBinaryInt()
CFBinaryPropertyList::readBinaryNullType()
CFBinaryPropertyList::readBinaryObject()
CFBinaryPropertyList::readBinaryObjectAt()
CFBinaryPropertyList::readBinaryReal()
CFBinaryPropertyList::readBinaryString()
CFBinaryPropertyList::readBinaryUnicodeString()
CFBinaryPropertyList::realToBinary()
CFBinaryPropertyList::stringToBinary()
CFBinaryPropertyList::toBinary()
CFBinaryPropertyList::typeBytes()
CFBinaryPropertyList::uniqueAndCountValues()
Class Constants
FORMAT_AUTO = 0 (line 58)

Format constant for automatic format recognizing

FORMAT_BINARY = 1 (line 46)

Format constant for binary format

FORMAT_XML = 2 (line 52)

Format constant for xml format

Documentation generated on Fri, 01 Jan 2010 21:33:33 +0100 by phpDocumentor 1.4.1