]>
git.immae.eu Git - github/wallabag/wallabag.git/blob - inc/3rdparty/libraries/MOBIClass/Record.php
3 * A Record of a PDB file
7 class Record
extends FileObject
{
14 * Length of the record
21 * @param string $data Data contained in the record
22 * @param int $length Length of the record (if set to -1,
23 * the length of $data will be taken)
25 public function __construct($data = "", $length = -1){
28 $this->length
= $length;
30 $this->length
= strlen($data);
34 public function compress($compression_method){
35 switch($compression_method){
39 case PALMDOC_COMPRESSION
:
40 throw new Exception("Not implemented yet");
43 throw new Exception("Not implemented yet");
46 throw new Exception("Invalid argument");
50 public function getByteLength(){
51 return $this->getLength();
55 * Get the length of the record
56 * @return int Length of the data
58 public function getLength(){
63 * Get the data contained in the record
64 * @return string Data contained in the record
66 public function get(){
71 * Set the data contained in the record
72 * @param string $value Data contained in the record
74 public function set($value){
78 public function serialize(){
81 public function unserialize($data){
85 public function __toString() {
86 $toShow = $this->data
;
87 if(strlen($this->data
) > 103){
88 $toShow = substr($this->data
, 0, 100)."...";
91 $out .= "\t".htmlspecialchars($toShow)."\n";