$this->currentBlock = $currentBlock;
}
+ /**
+ * Gets currently read data
+ *
+ * @return $current Currently read data
+ */
+ public function getCurrentBlock () {
+ // Return it
+ return $this->currentBlock;
+ }
+
/**
* Initializes this file class
*
* @return $seekPosition Current seek position
*/
public function determineSeekPosition () {
+ // Call pointer instance
return $this->getPointerInstance()->determineSeekPosition();
}
* @return $status Status of file seek: 0 = success, -1 = failed
*/
public function seek ($offset, $whence = SEEK_SET) {
+ // Call pointer instance
return $this->getPointerInstance()->seek($offset, $whence);
}
* @todo Handle seekStatus
*/
public function size () {
+ // Call pointer instance
return $this->getPointerInstance()->size();
}
* @throws InvalidResourceException If there is being set
*/
public function readFromFile () {
+ // Call pointer instance
return $this->getPointerInstance()->readFromFile();
}
* @return $data Data read from file
*/
public function read ($bytes) {
+ // Call pointer instance
return $this->getPointerInstance()->read($bytes);
}
* an invalid file resource
*/
public function writeToFile ($dataStream) {
+ // Call pointer instance
return $this->getPointerInstance()->writeToFile($dataStream);
}
* @return $status Status of this operation
*/
public function rewind () {
+ // Call pointer instance
return $this->getPointerInstance()->rewind();
}
* @return $isEndOfFileReached Whether the EOF has been reached
*/
public final function isEndOfFileReached () {
- return $this->isEndOfFileReached();
+ // Call pointer instance
+ return $this->getPointerInstance()->isEndOfFileReached();
}
/**
$this->next();
// Get current entry
- $current = $this->current();
+ $current = $this->getCurrentBlock();
// Simply output it
self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] current=%s', __METHOD__, __LINE__, print_r($current, TRUE)));
// Return result
return $isValid;
}
+
+ /**
+ * Gets current seek position ("key").
+ *
+ * @return $key Current key in iteration
+ */
+ public function key () {
+ // Call pointer instance
+ return $this->getPointerInstance()->determineSeekPosition();
+ }
}
// [EOF]