diff options
Diffstat (limited to 'inc/3rdparty/libraries/send2kindle/MOBIClass/PFLISRecord.php')
-rw-r--r-- | inc/3rdparty/libraries/send2kindle/MOBIClass/PFLISRecord.php | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/inc/3rdparty/libraries/send2kindle/MOBIClass/PFLISRecord.php b/inc/3rdparty/libraries/send2kindle/MOBIClass/PFLISRecord.php new file mode 100644 index 00000000..dbd8ecf5 --- /dev/null +++ b/inc/3rdparty/libraries/send2kindle/MOBIClass/PFLISRecord.php | |||
@@ -0,0 +1,58 @@ | |||
1 | <?php | ||
2 | /** | ||
3 | * A Record of a End file | ||
4 | * | ||
5 | * @author Pratyush | ||
6 | */ | ||
7 | class PFLISRecord extends FileObject { | ||
8 | /** | ||
9 | * @var FileElement | ||
10 | */ | ||
11 | private $elements; | ||
12 | |||
13 | public function __construct($leng){ | ||
14 | $this->elements = new FileElement(array( | ||
15 | "offsetL0"=>new FileString("FLIS", 4), //FLIS | ||
16 | "offsetL4"=>new FileInt(0x08), | ||
17 | "offsetL8"=>new FileShort(0x41), | ||
18 | "offsetL10"=>new FileString(6), | ||
19 | "offsetL16"=>new FileInt(0xFFFFFFFF), | ||
20 | "offsetL20"=>new FileShort(0x01), | ||
21 | "offsetL22"=>new FileShort(0x03), | ||
22 | "offsetL24"=>new FileInt(0x03), | ||
23 | "offsetL28"=>new FileInt(0x01), | ||
24 | "offsetL32"=>new FileInt(0xFFFFFFFF) | ||
25 | |||
26 | )); | ||
27 | } | ||
28 | public function getByteLength(){ | ||
29 | return $this->getLength(); | ||
30 | } | ||
31 | |||
32 | public function getLength(){ | ||
33 | return $this->elements->getByteLength(); | ||
34 | } | ||
35 | |||
36 | public function get(){ | ||
37 | return $this; | ||
38 | } | ||
39 | |||
40 | public function set($elements){ | ||
41 | throw new Exception("Unallowed set"); | ||
42 | } | ||
43 | |||
44 | public function serialize() { | ||
45 | return $this->elements->serialize(); | ||
46 | } | ||
47 | |||
48 | public function unserialize($data) { | ||
49 | $this->elements->unserialize($data); | ||
50 | } | ||
51 | |||
52 | public function __toString(){ | ||
53 | $output = "PalmDoc Record (".$this->getByteLength()." bytes):\n"; | ||
54 | $output .= $this->elements; | ||
55 | return $output; | ||
56 | } | ||
57 | |||
58 | } \ No newline at end of file | ||