Added some class fields/attributes.
authorRoland Haeder <roland@mxchange.org>
Thu, 15 May 2014 21:31:41 +0000 (23:31 +0200)
committerRoland Haeder <roland@mxchange.org>
Thu, 15 May 2014 21:31:41 +0000 (23:31 +0200)
Signed-off-by: Roland H├Ąder <roland@mxchange.org>
contrib/file_stack/format.txt
inc/classes/main/iterator/io/class_FileIoIterator.php
inc/classes/main/stacker/file_stack/class_BaseFileStack.php

index 03b6165..2a646c8 100644 (file)
@@ -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:
 
index cfd1297..1d54692 100644 (file)
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 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
         *
index 5ce4b33..5659051 100644 (file)
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 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
         *