Moved analyzeFile() to BaseFile where a much better place is (and duplicate
[core.git] / inc / classes / main / iterator / io / class_FileIoIterator.php
index 20d351f5e694d09b43376e8d1badc8b6f7368dfa..f2158c63eaf94a790caed9ebbb7ab3a08cc3ce4b 100644 (file)
@@ -134,6 +134,7 @@ class FileIoIterator extends BaseIterator implements SeekableWritableFileIterato
         * Advances to next "block" of bytes
         *
         * @return      void
+        * @todo        This method will load large but empty files in a whole
         */
        public function next () {
                // Is there nothing to read?
@@ -282,6 +283,18 @@ 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();
+       }
 }
 
 // [EOF]