|
QuickHashIntStringHash::loadFromFileThis factory method creates a hash from a file Description
public static QuickHashIntStringHash QuickHashIntStringHash::loadFromFile(string
$filename , int $size = 0, int $options = 0)
This factory method creates a new hash from a definition file on disk. The
file format consists of a signature
Example #1 QuickHash IntString file format 00000000 51 48 12 00 02 00 00 00 09 00 00 00 4f 4e 45 00 |QH..........ONE.| 00000010 4e 49 4e 45 00 01 00 00 00 00 00 00 00 03 00 00 |NINE............| 00000020 00 04 00 00 00 |.....| 00000025
Example #2 QuickHash IntString file format header signature ('QH'; key type: 1; value type: 2; filler: \0x00) 00000000 51 48 12 00 number of elements: 00000004 02 00 00 00 length of string values (9 characters): 00000008 09 00 00 00 string values: 0000000C 4f 4e 45 00 4e 49 4e 45 00 data string: 00000015 01 00 00 00 00 00 00 00 03 00 00 00 04 00 00 00 key/value 1 (key = 1, string index = 0 ("ONE")): 01 00 00 00 00 00 00 00 key/value 2 (key = 3, string index = 4 ("NINE")): 03 00 00 00 04 00 00 00 Parameters
Return ValuesReturns a new QuickHashIntStringHash. Examples
Example #3 QuickHashIntStringHash::loadFromFile example
The above example will output something similar to: Key 0 ( 0) is unset Key 1 ( 1) is set Key 2 ( 2) is set Key 3 ( 3) is set Key 4 ( 4) is unset Key 5 ( 5) is set Key 6 ( 6) is unset Key 7 ( 7) is set Key 8 ( 8) is unset Key 9 ( 9) is unset Key 10 ( a) is unset Key 11 ( b) is set Key 12 ( c) is unset Key 13 ( d) is set Key 14 ( e) is unset Key 15 ( f) is unset |