aboutsummaryrefslogtreecommitdiffhomepage
path: root/inc/3rdparty/libraries/MOBIClass/FileTri.php
diff options
context:
space:
mode:
authorThomas Citharel <tcit@tcit.fr>2014-12-14 00:16:39 +0100
committerThomas Citharel <tcit@tcit.fr>2014-12-14 00:16:39 +0100
commit1256e4c645c86f4165d052bf8116b957b373b837 (patch)
tree3cc3bd960df403a6e0645afcd9e4f5bbb68bfc0e /inc/3rdparty/libraries/MOBIClass/FileTri.php
parent9c55ed0923273da886497cb62302a79622e34a74 (diff)
parentdc69d3e8d895c87f9d26c2d1309e40d6090d4c8d (diff)
downloadwallabag-1256e4c645c86f4165d052bf8116b957b373b837.tar.gz
wallabag-1256e4c645c86f4165d052bf8116b957b373b837.tar.zst
wallabag-1256e4c645c86f4165d052bf8116b957b373b837.zip
Merge branch 'tcitworld-ebook' into dev
Diffstat (limited to 'inc/3rdparty/libraries/MOBIClass/FileTri.php')
-rw-r--r--inc/3rdparty/libraries/MOBIClass/FileTri.php41
1 files changed, 41 insertions, 0 deletions
diff --git a/inc/3rdparty/libraries/MOBIClass/FileTri.php b/inc/3rdparty/libraries/MOBIClass/FileTri.php
new file mode 100644
index 00000000..6cacc0b0
--- /dev/null
+++ b/inc/3rdparty/libraries/MOBIClass/FileTri.php
@@ -0,0 +1,41 @@
1<?php
2
3/**
4 * Description of FileTri
5 *
6 * @author Sander
7 */
8class 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?>