From: Roland Haeder Date: Wed, 4 Jun 2014 21:24:55 +0000 (+0200) Subject: Also add getFileSize() here, too. This satisfies the interface. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=565aa3534dea60144d0254e342110916b4ef3928;p=core.git Also add getFileSize() here, too. This satisfies the interface. Signed-off-by: Roland Häder --- 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]