]> git.immae.eu Git - github/wallabag/wallabag.git/blob - inc/3rdparty/libraries/MOBIClass/FileTri.php
phpepub via composer
[github/wallabag/wallabag.git] / inc / 3rdparty / libraries / MOBIClass / FileTri.php
1 <?php
2
3 /**
4 * Description of FileTri
5 *
6 * @author Sander
7 */
8 class FileTri extends FileObject {
9 private $data;
10
11 /**
12 * Make a tri-byte to be stored in a file
13 * @param tri-byte $n
14 */
15 public function __construct($n = 0){
16 parent::__construct(3);
17 $this->set($n);
18 }
19
20 public function get(){
21 return $this->data;
22 }
23
24 public function set($value){
25 $this->data = intval($value) & 0xFFFFFF;
26 }
27
28 public function serialize() {
29 return $this->triToString($this->data);
30 }
31
32 public function unserialize($data) {
33 __construct($this->toInt($data));
34 }
35
36
37 public function __toString(){
38 return "FileTri: {".$this->triAsString($this->data)."}";
39 }
40 }
41 ?>