]> git.mxchange.org Git - core.git/blobdiff - inc/classes/main/iterator/io/class_FileIoIterator.php
Satified interface.
[core.git] / inc / classes / main / iterator / io / class_FileIoIterator.php
index 3437d1165902af54a1cc557527ec90cdd924844a..21054378442e7c066377967ade9b51fd6e03cea6 100644 (file)
@@ -55,13 +55,8 @@ class FileIoIterator extends BaseIterator implements SeekableWritableFileIterato
         * @return      $current        Currently read data
         */
        public function current () {
-               // Default is null
-               $current = null;
-
-               $this->partialStub('Please implement this method.');
-
-               // Return it
-               return $current;
+               // Call pointer instance
+               return $this->getPointerInstance()->current();
        }
 
        /**
@@ -80,7 +75,8 @@ class FileIoIterator extends BaseIterator implements SeekableWritableFileIterato
         * @return      void
         */
        public function next () {
-               $this->partialStub('Please implement this method.');
+               // Call pointer instance
+               $this->getPointerInstance()->next();
        }
 
        /**
@@ -97,10 +93,11 @@ class FileIoIterator extends BaseIterator implements SeekableWritableFileIterato
         * Checks wether the current entry is valid (not at the end of the file).
         * This method will return TRUE if an emptied (nulled) entry has been found.
         *
-        * @return      void
+        * @return      $isValid        Whether the next entry is valid
         */
        public function valid () {
-               $this->partialStub('Please implement this method.');
+               // Call pointer instance
+               return $this->getPointerInstance()->valid();
        }
 
        /**
@@ -152,6 +149,49 @@ class FileIoIterator extends BaseIterator implements SeekableWritableFileIterato
                // Call pointer instance
                return $this->getPointerInstance()->read($bytes);
        }
+
+       /**
+        * Analyzes entries in index file. This will count all found (and valid)
+        * entries, mark invalid as damaged and count gaps ("fragmentation"). If
+        * only gaps are found, the file is considered as "virgin" (no entries).
+        *
+        * @return      void
+        */
+       public function analyzeFile () {
+               // Just call the pointer instance
+               $this->getPointerInstance()->analyzeFile();
+       }
+
+       /**
+        * Checks whether the file header is initialized
+        *
+        * @return      $isInitialized  Whether the file header is initialized
+        */
+       public function isFileHeaderInitialized () {
+               // Just call the pointer instance
+               return $this->getPointerInstance()->isFileHeaderInitialized();
+       }
+
+       /**
+        * Creates the assigned file
+        *
+        * @return      void
+        */
+       public function createFileHeader () {
+               // Just call the pointer instance
+               $this->getPointerInstance()->createFileHeader();
+       }
+
+       /**
+        * Pre-allocates file (if enabled) with some space for later faster write access.
+        *
+        * @param       $type   Type of the file
+        * @return      void
+        */
+       public function preAllocateFile ($type) {
+               // Just call the pointer instance
+               $this->getPointerInstance()->preAllocateFile($type);
+       }
 }
 
 // [EOF]