/** * Constructs the class with given parameters and options. * * @param Reader $reader The reader object. * @param Array $options The options array. */ public function __construct($reader, &$options = array()) { $this->_reader = $reader; $this->_options = $options; $this->_offset = $this->_reader->getOffset(); $this->_id = $this->_reader->readGUID(); $this->_size = $this->_reader->readInt64LE(); }
/** * Returns the next ASF object or <var>false</var> if end of stream has been * reached. Returned objects are of the type ASF_Object or of any of its child * types. * * @todo Only the ASF_Header_Object top level object is regognized. * @return ASF_Object */ public function nextObject() { $object = false; if ($this->hasObjects()) { $guid = $this->_reader->readGUID(); $size = $this->_reader->readInt64LE(); $offset = $this->_reader->getOffset(); switch ($guid) { case "75b22630-668e-11cf-a6d9-00aa0062ce6c": /* ASF_Header_Object */ $object = new ASF_HeaderObject($this->_reader, $guid, $size); break; default: $object = new ASF_Object($this->_reader, $guid, $size); } $this->_reader->setOffset($offset - 24 + $size); } return $object; }
/** * Constructs the class with given parameters and options. * * @param Reader $reader The reader object. * @param Array $options The options array. */ public function __construct($reader, &$options = array()) { if (($this->_reader = $reader) === null) { $this->_type = strtolower(substr(get_class($this), -4)); } else { $this->_offset = $this->_reader->getOffset(); $this->_size = $this->_reader->readUInt32BE(); $this->_type = $this->_reader->read(4); if ($this->_size == 1) $this->_size = $this->_reader->readInt64BE(); if ($this->_size == 0) $this->_size = $this->_reader->getSize() - $this->_offset; if ($this->_type == "uuid") $this->_type = $this->_reader->readGUID(); } $this->_options = $options; }