X-Git-Url: https://git.mxchange.org/?p=core.git;a=blobdiff_plain;f=inc%2Fclasses%2Fmain%2Findex%2Fclass_BaseIndex.php;h=e28faccd035b2f44b430192ebf5dea765e0d36ea;hp=6dd651caf43d64d565716dfbfea6ca865223d21a;hb=bde1a7331a8a5c1e4a304583c0db268026aeb8a8;hpb=ce7d4f1ec37db463e6008655bbc56b811c5a5d86 diff --git a/inc/classes/main/index/class_BaseIndex.php b/inc/classes/main/index/class_BaseIndex.php index 6dd651ca..e28faccd 100644 --- a/inc/classes/main/index/class_BaseIndex.php +++ b/inc/classes/main/index/class_BaseIndex.php @@ -294,6 +294,46 @@ class BaseIndex extends BaseFrameworkSystem { // Call iterator's method return $this->getIteratorInstance()->getFileSize(); } + + /** + * Writes data at given position + * + * @param $seekPosition Seek position + * @param $data Data to be written + * @param $flushHeader Whether to flush the header (default: flush) + * @return void + * @throws UnsupportedOperationException This method is not (and maybe never will be) supported + */ + public function writeData ($seekPosition, $data, $flushHeader = TRUE) { + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] seekPosition=%s,data[]=%s,flushHeader=%d', __METHOD__, __LINE__, $seekPosition, gettype($data), intval($flushHeader))); + throw new UnsupportedOperationException(array($this, __FUNCTION__, $this->getIteratorInstance()->getPointerInstance()), self::EXCEPTION_UNSPPORTED_OPERATION); + } + + /** + * Writes given value to the file and returns a hash and gap position for it + * + * @param $groupId Group identifier + * @param $value Value to be added to the stack + * @return $data Hash and gap position + * @throws UnsupportedOperationException If this method is called + */ + public function writeValueToFile ($groupId, $value) { + self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . '] groupId=' . $groupId . ',value[' . gettype($value) . ']=' . print_r($value, TRUE)); + throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION); + } + + /** + * Writes given raw data to the file and returns a gap position and length + * + * @param $groupId Group identifier + * @param $hash Hash from encoded value + * @param $encoded Encoded value to be written to the file + * @return $data Gap position and length of the raw data + */ + public function writeDataToFreeGap ($groupId, $hash, $encoded) { + self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . '] groupId=' . $groupId . ',hash=' . $hash . ',encoded()=' . strlen($encoded)); + throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION); + } } // [EOF]