]> git.mxchange.org Git - core.git/blobdiff - framework/main/classes/file_directories/binary/class_BaseBinaryFile.php
Continued:
[core.git] / framework / main / classes / file_directories / binary / class_BaseBinaryFile.php
index 1b1594ffa16ce772f600b87c9ac1982f88d37078..8fcaeca9dcba94f78af136793548859d83bcfb26 100644 (file)
@@ -48,68 +48,6 @@ abstract class BaseBinaryFile extends BaseAbstractFile implements BinaryFile {
        use StackableTrait;
        use IndexableTrait;
 
-       /**
-        * Separator for header data
-        */
-       const SEPARATOR_HEADER_DATA = 0x01;
-
-       /**
-        * Separator header->entries
-        */
-       const SEPARATOR_HEADER_ENTRIES = 0x02;
-
-       /**
-        * Separator group->hash
-        */
-       const SEPARATOR_GROUP_HASH = 0x03;
-
-       /**
-        * Separator hash->value
-        */
-       const SEPARATOR_HASH_VALUE = 0x04;
-
-       /**
-        * Separator entry->entry
-        */
-       const SEPARATOR_ENTRIES = 0x05;
-
-       /**
-        * Separator type->position
-        */
-       const SEPARATOR_TYPE_POSITION = 0x06;
-
-       /**
-        * Length of count
-        */
-       const LENGTH_COUNT = 20;
-
-       /**
-        * Length of position
-        */
-       const LENGTH_POSITION = 20;
-
-       /**
-        * Length of group
-        */
-       const LENGTH_GROUP = 10;
-
-       /**
-        * Maximum length of entry type
-        */
-       const LENGTH_TYPE = 20;
-
-       //***** Array elements for 'gaps' array *****
-
-       /**
-        * Start of gap
-        */
-       const GAPS_INDEX_START = 'start';
-
-       /**
-        * End of gap
-        */
-       const GAPS_INDEX_END = 'end';
-
        /**
         * Current seek position
         */
@@ -275,8 +213,8 @@ abstract class BaseBinaryFile extends BaseAbstractFile implements BinaryFile {
                /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-BINARY-FILE: this->gaps()=%d', count($this->gaps)));
                foreach ($this->gaps as $gap) {
                        // Calculate size of found gap: end-start including both
-                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-BINARY-FILE: gap[%s]=%d,ga[%s]=%d', self::GAPS_INDEX_START, $gap[self::GAPS_INDEX_START], self::GAPS_INDEX_END, $gap[self::GAPS_INDEX_END]));
-                       $gapsSize += ($gap[self::GAPS_INDEX_END] - $gap[self::GAPS_INDEX_START]);
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-BINARY-FILE: gap[%s]=%d,ga[%s]=%d', BinaryFile::GAPS_INDEX_START, $gap[BinaryFile::GAPS_INDEX_START], BinaryFile::GAPS_INDEX_END, $gap[BinaryFile::GAPS_INDEX_END]));
+                       $gapsSize += ($gap[BinaryFile::GAPS_INDEX_END] - $gap[BinaryFile::GAPS_INDEX_START]);
 
                        // Debug message
                        //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-BINARY-FILE: gapsSize=%d', $gapsSize));
@@ -336,8 +274,8 @@ abstract class BaseBinaryFile extends BaseAbstractFile implements BinaryFile {
                // Push to gaps array
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-BINARY-FILE: startPosition=%d,endPosition=%d - CALLED!', $startPosition, $endPosition));
                array_push($this->gaps, [
-                       self::GAPS_INDEX_START  => $startPosition,
-                       self::GAPS_INDEX_END    => $endPosition,
+                       BinaryFile::GAPS_INDEX_START  => $startPosition,
+                       BinaryFile::GAPS_INDEX_END    => $endPosition,
                ]);
 
                // Trace message
@@ -514,7 +452,7 @@ abstract class BaseBinaryFile extends BaseAbstractFile implements BinaryFile {
                }
 
                // Determine it
-               $isFound = (strpos($str, chr(self::SEPARATOR_ENTRIES)) !== false);
+               $isFound = (strpos($str, chr(BinaryFile::SEPARATOR_ENTRIES)) !== false);
 
                // Return result
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-BINARY-FILE: isFound=%d - EXIT!', intval($isFound)));
@@ -915,7 +853,7 @@ abstract class BaseBinaryFile extends BaseAbstractFile implements BinaryFile {
                }
 
                // Separate data
-               $dataArray = explode(chr(self::SEPARATOR_ENTRIES), $data);
+               $dataArray = explode(chr(BinaryFile::SEPARATOR_ENTRIES), $data);
 
                // Left part is the actual block, right one the back-buffer data, if found
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-BINARY-FILE: dataArray()=%d', count($dataArray)));