Ejemplo n.º 1
0
 /**
  * Reads and constructs the objects found within this object.
  */
 protected function constructObjects($defaultclassnames = array())
 {
   while (true) {
     $offset = $this->_reader->getOffset();
     if ($offset >= $this->getOffset() + $this->getSize())
       break;
     $guid = $this->_reader->readGUID();
     $size = $this->_reader->readInt64LE();
     
     $this->_reader->setOffset($offset);
     if (isset($defaultclassnames[$guid])) {
       if (@fopen($filename = "ASF/Object/" . $defaultclassnames[$guid] .
                  ".php", "r", true) !== false)
         require_once($filename);
       if (class_exists
           ($classname = "ASF_Object_" . $defaultclassnames[$guid]))
         $object = new $classname($this->_reader, $this->_options);
       else
         $object = new ASF_Object($this->_reader, $this->_options);
     } else
       $object = new ASF_Object($this->_reader, $this->_options);
     $object->setParent($this);
     if (!$this->hasObject($object->getIdentifier()))
       $this->_objects[$object->getIdentifier()] = array();
     $this->_objects[$object->getIdentifier()][] = $object;
     $this->_reader->setOffset($offset + $size);
   }
 }