]>
Commit | Line | Data |
---|---|---|
4188f38a | 1 | <?php |
2 | /** | |
3 | * A Record of a End file | |
4 | * | |
5 | * @author Pratyush | |
6 | */ | |
7 | class PFCISRecord extends FileObject { | |
8 | /** | |
9 | * @var FileElement | |
10 | */ | |
11 | private $elements; | |
12 | ||
13 | public function __construct($leng){ | |
14 | $this->elements = new FileElement(array( | |
15 | "offset0"=>new FileString("FCIS", 4), //FCIS | |
16 | "offset4"=>new FileInt(0x014), | |
17 | "offset8"=>new FileInt(0x10), | |
18 | "offset12"=>new FileInt(0x01), | |
19 | "offset16"=>new FileInt(), | |
20 | "offset20"=>new FileInt($leng), | |
21 | "offset24"=>new FileInt(), | |
22 | "offset28"=>new FileInt(0x20), | |
23 | "offset32"=>new FileInt(0x08), | |
24 | "offset36"=>new FileShort(0x01), | |
25 | "offset38"=>new FileShort(0x01), | |
26 | "offset40"=>new FileInt() | |
27 | )); | |
28 | } | |
29 | public function getByteLength(){ | |
30 | return $this->getLength(); | |
31 | } | |
32 | ||
33 | public function getLength(){ | |
34 | return $this->elements->getByteLength(); | |
35 | } | |
36 | ||
37 | public function get(){ | |
38 | return $this; | |
39 | } | |
40 | ||
41 | public function set($elements){ | |
42 | throw new Exception("Unallowed set"); | |
43 | } | |
44 | ||
45 | public function serialize() { | |
46 | return $this->elements->serialize(); | |
47 | } | |
48 | ||
49 | public function unserialize($data) { | |
50 | $this->elements->unserialize($data); | |
51 | } | |
52 | ||
53 | public function __toString(){ | |
54 | $output = "PalmDoc Record (".$this->getByteLength()." bytes):\n"; | |
55 | $output .= $this->elements; | |
56 | return $output; | |
57 | } | |
58 | ||
59 | } |