diff options
author | tcit <tcit@tcit.fr> | 2014-07-24 15:49:36 +0200 |
---|---|---|
committer | tcit <tcit@tcit.fr> | 2014-07-24 15:49:36 +0200 |
commit | 4188f38ad56d7ba2ea46e94403f305243514f80c (patch) | |
tree | f357ddbd0d846ebae0ecf5d2ab00d6b7dd6eb8d5 /inc/3rdparty/libraries/send2kindle/MOBIClass/PFCISRecord.php | |
parent | 2b58426b2d4a7f1585d5d7667c0a4fbea4cd29dd (diff) | |
download | wallabag-4188f38ad56d7ba2ea46e94403f305243514f80c.tar.gz wallabag-4188f38ad56d7ba2ea46e94403f305243514f80c.tar.zst wallabag-4188f38ad56d7ba2ea46e94403f305243514f80c.zip |
add pdf and mobi libraries
Diffstat (limited to 'inc/3rdparty/libraries/send2kindle/MOBIClass/PFCISRecord.php')
-rw-r--r-- | inc/3rdparty/libraries/send2kindle/MOBIClass/PFCISRecord.php | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/inc/3rdparty/libraries/send2kindle/MOBIClass/PFCISRecord.php b/inc/3rdparty/libraries/send2kindle/MOBIClass/PFCISRecord.php new file mode 100644 index 00000000..9e72cc1c --- /dev/null +++ b/inc/3rdparty/libraries/send2kindle/MOBIClass/PFCISRecord.php | |||
@@ -0,0 +1,59 @@ | |||
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 | } \ No newline at end of file | ||