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

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

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

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

	public function set($value){
		$this->data = intval($value);
	}
	
	public function serialize() {
		return $this->intToString($this->data);
	}

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

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