From bf7bc14731bd4f410f0d54d538f7c9dd35b1a12f Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Thu, 15 May 2014 23:31:41 +0200 Subject: [PATCH] Added some class fields/attributes. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- contrib/file_stack/format.txt | 2 +- .../main/iterator/io/class_FileIoIterator.php | 10 ++++++++++ .../file_stack/class_BaseFileStack.php | 20 +++++++++++++++++++ 3 files changed, 31 insertions(+), 1 deletion(-) diff --git a/contrib/file_stack/format.txt b/contrib/file_stack/format.txt index 03b61652..2a646c82 100644 --- a/contrib/file_stack/format.txt +++ b/contrib/file_stack/format.txt @@ -9,7 +9,7 @@ Purpose: | "magic" | separator | count | position | separator | ---------+-----------+-----------+----------+---------------+-----------+ Bytes: | 9 | 1 | 20 (hex) | 2 - n^2 (hex) | 1 | ---------+-----------+-----------+----------+---------------+-----------+ -Example: | STACKv1.0 | ??? | 00...ff | 01 | ??? | +Example: | STACKv1.0 | 00 | 00...ff | 01 | ff | Continued: diff --git a/inc/classes/main/iterator/io/class_FileIoIterator.php b/inc/classes/main/iterator/io/class_FileIoIterator.php index cfd1297b..1d546922 100644 --- a/inc/classes/main/iterator/io/class_FileIoIterator.php +++ b/inc/classes/main/iterator/io/class_FileIoIterator.php @@ -22,6 +22,16 @@ * along with this program. If not, see . */ class FileIoIterator extends BaseIterator implements SeekableWritableFileIterator { + /** + * Current absolute seek position (returned by key()) + */ + private $seekPosition = -1; + + /** + * Total entries (read from file) + */ + private $totalEntriesFile = -1; + /** * Protected constructor * diff --git a/inc/classes/main/stacker/file_stack/class_BaseFileStack.php b/inc/classes/main/stacker/file_stack/class_BaseFileStack.php index 5ce4b338..56590510 100644 --- a/inc/classes/main/stacker/file_stack/class_BaseFileStack.php +++ b/inc/classes/main/stacker/file_stack/class_BaseFileStack.php @@ -22,6 +22,26 @@ * along with this program. If not, see . */ class BaseFileStack extends BaseStacker { + /** + * Magic for this stack + */ + const STACK_MAGIC = 'STACKv0.1'; + + /** + * Separator magic->count + */ + const SEPARATOR_MAGIC_COUNT = 0x00; + + /** + * Separator position->entries + */ + const SEPARATOR_SEEK_POS_ENTRIES = 0xff; + + /** + * Separator hash->name + */ + const SEPARATOR_HASH_NAME = 0x01; + /** * Protected constructor * -- 2.39.5