From 565aa3534dea60144d0254e342110916b4ef3928 Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Wed, 4 Jun 2014 23:24:55 +0200 Subject: [PATCH] Also add getFileSize() here, too. This satisfies the interface. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- .../iterator/class_SeekableWritableFileIterator.php | 7 +++++++ inc/classes/main/iterator/file/class_FileIterator.php | 10 ++++++++++ inc/classes/main/stacker/file/class_BaseFileStack.php | 9 +++++++++ 3 files changed, 26 insertions(+) diff --git a/inc/classes/interfaces/iterator/class_SeekableWritableFileIterator.php b/inc/classes/interfaces/iterator/class_SeekableWritableFileIterator.php index 674fc626..3bb0d816 100644 --- a/inc/classes/interfaces/iterator/class_SeekableWritableFileIterator.php +++ b/inc/classes/interfaces/iterator/class_SeekableWritableFileIterator.php @@ -139,6 +139,13 @@ interface SeekableWritableFileIterator extends SeekableIterator { * @return $totalEntries Total entries in this file */ function getCounter (); + + /** + * "Getter" for file size + * + * @return $fileSize Size of currently loaded file + */ + function getFileSize (); } // [EOF] diff --git a/inc/classes/main/iterator/file/class_FileIterator.php b/inc/classes/main/iterator/file/class_FileIterator.php index b40ef6b4..e7336074 100644 --- a/inc/classes/main/iterator/file/class_FileIterator.php +++ b/inc/classes/main/iterator/file/class_FileIterator.php @@ -268,6 +268,16 @@ class FileIterator extends BaseIterator implements SeekableWritableFileIterator // Call block instance return $this->getBlockInstance()->getCounter(); } + + /** + * "Getter" for file size + * + * @return $fileSize Size of currently loaded file + */ + public function getFileSize () { + // Call block instance + return $this->getBlockInstance()->getFileSize(); + } } // [EOF] diff --git a/inc/classes/main/stacker/file/class_BaseFileStack.php b/inc/classes/main/stacker/file/class_BaseFileStack.php index 6b50a6e0..a07d5034 100644 --- a/inc/classes/main/stacker/file/class_BaseFileStack.php +++ b/inc/classes/main/stacker/file/class_BaseFileStack.php @@ -491,6 +491,15 @@ class BaseFileStack extends BaseStacker { throw new UnsupportedOperationException(array($this, __FUNCTION__, $this->getIteratorInstance()->getPointerInstance()), self::EXCEPTION_UNSPPORTED_OPERATION); } + /** + * "Getter" for file size + * + * @return $fileSize Size of currently loaded file + */ + public function getFileSize () { + // Call iterator's method + return $this->getIteratorInstance()->getFileSize(); + } } // [EOF] -- 2.39.5