X-Git-Url: https://git.mxchange.org/?p=core.git;a=blobdiff_plain;f=inc%2Fclasses%2Fmain%2Fstacker%2Ffile%2Fclass_BaseFileStack.php;h=6b50a6e0d934b81b3c0d434972dcdfa5c00d3452;hp=6379821f7aed5da14cea8c8d95446437fda02c97;hb=202f8c1c1d46d1292918b7110547952446a53391;hpb=dd2935c1e126e5b2bfc7e222afea4a47a81ed2c6 diff --git a/inc/classes/main/stacker/file/class_BaseFileStack.php b/inc/classes/main/stacker/file/class_BaseFileStack.php index 6379821f..6b50a6e0 100644 --- a/inc/classes/main/stacker/file/class_BaseFileStack.php +++ b/inc/classes/main/stacker/file/class_BaseFileStack.php @@ -120,7 +120,7 @@ class BaseFileStack extends BaseStacker { chr(BaseFile::SEPARATOR_HEADER_DATA), // Total entries (will be zero) and pad it to 20 chars - str_pad($this->dec2hex($this->getCounter()), BaseFile::LENGTH_COUNT, '0', STR_PAD_LEFT), + str_pad($this->dec2hex($this->getIteratorInstance()->getCounter()), BaseFile::LENGTH_COUNT, '0', STR_PAD_LEFT), // Separator count<->seek position chr(BaseFile::SEPARATOR_HEADER_DATA), @@ -400,7 +400,7 @@ class BaseFileStack extends BaseStacker { */ public function getStackCount ($stackerName) { // Now, simply return the found count value, this must be up-to-date then! - return $this->getCounter(); + return $this->getIteratorInstance()->getCounter(); } /** @@ -480,6 +480,17 @@ class BaseFileStack extends BaseStacker { public function updateSeekPosition () { throw new UnsupportedOperationException(array($this, __FUNCTION__, $this->getIteratorInstance()->getPointerInstance()), self::EXCEPTION_UNSPPORTED_OPERATION); } + + /** + * Getter for total entries + * + * @return $totalEntries Total entries in this file + * @throws UnsupportedOperationException This method is not (and maybe never will be) supported + */ + public final function getCounter () { + throw new UnsupportedOperationException(array($this, __FUNCTION__, $this->getIteratorInstance()->getPointerInstance()), self::EXCEPTION_UNSPPORTED_OPERATION); + } + } // [EOF]