* @author Christian Kruse * @copyright Copyright © 2018 Teclib * @package plist * @license MIT * @link https://github.com/TECLIB/CFPropertyList/ * @link http://developer.apple.com/documentation/Darwin/Reference/ManPages/man5/plist.5.html Property Lists * ------------------------------------------------------------------------------ */ namespace CFPropertyList; use \DOMDocument; use \Iterator; use \ArrayAccess; class CFBoolean extends CFType { /** * Get XML-Node. * Returns <true> if $value is a true, <false> if $value is false. * @param DOMDocument $doc DOMDocument to create DOMNode in * @param string $nodeName For compatibility reasons; just ignore it * @return DOMNode <true> or <false>-Element */ public function toXML(DOMDocument $doc, $nodeName = "") { return $doc->createElement($this->value ? 'true' : 'false'); } /** * convert value to binary representation * @param CFBinaryPropertyList The binary property list object * @return The offset in the object table */ public function toBinary(CFBinaryPropertyList &$bplist) { return $bplist->boolToBinary($this->value); } }