aboutsummaryrefslogtreecommitdiffhomepage
path: root/inc/3rdparty/libraries/send2kindle/MOBIClass/FileTri.php
blob: 6cacc0b00d7e353dfe999afcd09e2806d80395ac (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
<?php

/**
 * Description of FileTri
 *
 * @author Sander
 */
class FileTri extends FileObject {
	private $data;

	/**
	 * Make a tri-byte to be stored in a file
	 * @param tri-byte $n
	 */
	public function __construct($n = 0){
		parent::__construct(3);
		$this->set($n);
	}

	public function get(){
		return $this->data;
	}

	public function set($value){
		$this->data = intval($value) & 0xFFFFFF;
	}

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

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


	public function __toString(){
		return "FileTri: {".$this->triAsString($this->data)."}";
	}
}
?>