aboutsummaryrefslogtreecommitdiffhomepage
path: root/inc/3rdparty/libraries/send2kindle/MOBIClass/PFCISRecord.php
blob: 9e72cc1c5a0d9182ec3e0c395dd358273f7bf4c6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<?php
/**
 * A Record of a End file
 *
 * @author Pratyush
 */
 class PFCISRecord extends FileObject {
 /**
	 * @var FileElement
	 */
	private $elements;

	public function __construct($leng){
	$this->elements = new FileElement(array(
			"offset0"=>new FileString("FCIS", 4),	//FCIS
			"offset4"=>new FileInt(0x014),
			"offset8"=>new FileInt(0x10),
			"offset12"=>new FileInt(0x01),
			"offset16"=>new FileInt(),
			"offset20"=>new FileInt($leng),
			"offset24"=>new FileInt(),
			"offset28"=>new FileInt(0x20),
			"offset32"=>new FileInt(0x08),
			"offset36"=>new FileShort(0x01),
			"offset38"=>new FileShort(0x01),
			"offset40"=>new FileInt()
				));
	}
	public function getByteLength(){
		return $this->getLength();
	}

	public function getLength(){
		return $this->elements->getByteLength();
	}

	public function get(){
		return $this;
	}

	public function set($elements){
		throw new Exception("Unallowed set");
	}

	public function serialize() {
		return $this->elements->serialize();
	}

	public function unserialize($data) {
		$this->elements->unserialize($data);
	}

	public function __toString(){
		$output = "PalmDoc Record (".$this->getByteLength()." bytes):\n";
		$output .= $this->elements;
		return $output;
	}			
	
}