Added more methods (required).
[core.git] / inc / classes / main / file_directories / class_BaseFile.php
index 632cbdcec73bce2dfe7dffaf79711c2de2178988..303371c6791e25579d226e7a0f32693f8f577a1f 100644 (file)
@@ -141,6 +141,16 @@ y   * @return      void
                $this->currentBlock = $currentBlock;
        }
 
+       /**
+        * Gets currently read data
+        *
+        * @return      $current        Currently read data
+        */
+       public function getCurrentBlock () {
+               // Return it
+               return $this->currentBlock;
+       }
+
        /**
         * Initializes this file class
         *
@@ -175,6 +185,7 @@ y    * @return      void
         * @return      $seekPosition   Current seek position
         */
        public function determineSeekPosition () {
+               // Call pointer instance
                return $this->getPointerInstance()->determineSeekPosition();
        }
 
@@ -186,6 +197,7 @@ y    * @return      void
         * @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);
        }
 
@@ -196,6 +208,7 @@ y    * @return      void
         * @todo        Handle seekStatus
         */
        public function size () {
+               // Call pointer instance
                return $this->getPointerInstance()->size();
        }
 
@@ -208,6 +221,7 @@ y    * @return      void
         * @throws      InvalidResourceException        If there is being set
         */
        public function readFromFile () {
+               // Call pointer instance
                return $this->getPointerInstance()->readFromFile();
        }
 
@@ -218,6 +232,7 @@ y    * @return      void
         * @return      $data   Data read from file
         */
        public function read ($bytes) {
+               // Call pointer instance
                return $this->getPointerInstance()->read($bytes);
        }
 
@@ -232,6 +247,7 @@ y    * @return      void
         *                                                                                      an invalid file resource
         */
        public function writeToFile ($dataStream) {
+               // Call pointer instance
                return $this->getPointerInstance()->writeToFile($dataStream);
        }
 
@@ -241,6 +257,7 @@ y    * @return      void
         * @return      $status         Status of this operation
         */
        public function rewind () {
+               // Call pointer instance
                return $this->getPointerInstance()->rewind();
        }
 
@@ -250,7 +267,8 @@ y    * @return      void
         * @return      $isEndOfFileReached             Whether the EOF has been reached
         */
        public final function isEndOfFileReached () {
-               return $this->isEndOfFileReached();
+               // Call pointer instance
+               return $this->getPointerInstance()->isEndOfFileReached();
        }
 
        /**
@@ -281,7 +299,7 @@ y    * @return      void
                        $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)));
@@ -389,6 +407,16 @@ y   * @return      void
                // 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]