* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-class FileStackIndex extends BaseIndex implements IndexableStack, CalculatableBlock, Registerable {
+class FileStackIndex extends BaseIndex implements IndexableStack, Registerable {
/**
* Protected constructor
*
// Wait until a entry/block separator has been found
$data = $this->getBackBuffer();
- while (($this->getPointerInstance()->isEndOfFileReached()) && (!$this->getBlockInstance()->isBlockSeparatorFound($data))) {
+ while ((!$this->getPointerInstance()->isEndOfFileReached()) && (!$this->getBlockInstance()->isBlockSeparatorFound($data))) {
// Then read the block
$data .= $this->read($length);
/* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('data()=' . strlen($data));
// EOF reached?
if ($this->getPointerInstance()->isEndOfFileReached()) {
// Then abort here silently
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('EOF reached.');
return;
} // END - if
// Separate data
$dataArray = explode(self::getBlockSeparator(), $data);
+ // This array must contain two elements
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('dataArray=' . print_r($dataArray, TRUE));
+ assert(count($dataArray) == 2);
+
// Left part is the actual block, right one the back-buffer data
$this->setCurrentBlock($dataArray[0]);
$this->setBackBuffer($dataArray[1]);