Go to the documentation of this file.00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 require_once('PEAR.php');
00024 require_once('classes/OLE/OLE.php');
00025
00033 class OLE_PPS extends PEAR
00034 {
00039 var $No;
00040
00045 var $Name;
00046
00051 var $Type;
00052
00057 var $PrevPps;
00058
00063 var $NextPps;
00064
00069 var $DirPps;
00070
00075 var $Time1st;
00076
00081 var $Time2nd;
00082
00087 var $_StartBlock;
00088
00093 var $Size;
00094
00099 var $_data;
00100
00105 var $children = array();
00106
00121 function OLE_PPS($No, $name, $type, $prev, $next, $dir, $time_1st, $time_2nd, $data, $children)
00122 {
00123 $this->No = $No;
00124 $this->Name = $name;
00125 $this->Type = $type;
00126 $this->PrevPps = $prev;
00127 $this->NextPps = $next;
00128 $this->DirPps = $dir;
00129 $this->Time1st = $time_1st;
00130 $this->Time2nd = $time_2nd;
00131 $this->_data = $data;
00132 $this->children = $children;
00133 if ($data != '') {
00134 $this->Size = strlen($data);
00135 }
00136 else {
00137 $this->Size = 0;
00138 }
00139 }
00140
00147 function _DataLen()
00148 {
00149 if (!isset($this->_data)) {
00150 return 0;
00151 }
00152 if (isset($this->_PPS_FILE))
00153 {
00154 fseek($this->_PPS_FILE, 0);
00155 $stats = fstat($this->_PPS_FILE);
00156 return $stats[7];
00157 }
00158 else {
00159 return strlen($this->_data);
00160 }
00161 }
00162
00169 function _getPpsWk()
00170 {
00171 $ret = $this->Name;
00172 for ($i = 0; $i < (64 - strlen($this->Name)); $i++) {
00173 $ret .= "\x00";
00174 }
00175 $ret .= pack("v", strlen($this->Name) + 2)
00176 . pack("c", $this->Type)
00177 . pack("c", 0x00)
00178 . pack("V", $this->PrevPps)
00179 . pack("V", $this->NextPps)
00180 . pack("V", $this->DirPps)
00181 . "\x00\x09\x02\x00"
00182 . "\x00\x00\x00\x00"
00183 . "\xc0\x00\x00\x00"
00184 . "\x00\x00\x00\x46"
00185 . "\x00\x00\x00\x00"
00186 . OLE::LocalDate2OLE($this->Time1st)
00187 . OLE::LocalDate2OLE($this->Time2nd)
00188 . pack("V", isset($this->_StartBlock)?
00189 $this->_StartBlock:0)
00190 . pack("V", $this->Size)
00191 . pack("V", 0);
00192 return $ret;
00193 }
00194
00204 function _savePpsSetPnt(&$pps_array)
00205 {
00206 $pps_array[count($pps_array)] = &$this;
00207 $this->No = count($pps_array) - 1;
00208 $this->PrevPps = 0xFFFFFFFF;
00209 $this->NextPps = 0xFFFFFFFF;
00210 if (count($this->children) > 0) {
00211 $this->DirPps = $this->children[0]->_savePpsSetPnt($pps_array);
00212 }
00213 else {
00214 $this->DirPps = 0xFFFFFFFF;
00215 }
00216 return $this->No;
00217 }
00218 }
00219 ?>