本文整理汇总了PHP中PHPExcel_Reader_Excel5::_GetInt2d方法的典型用法代码示例。如果您正苦于以下问题:PHP PHPExcel_Reader_Excel5::_GetInt2d方法的具体用法?PHP PHPExcel_Reader_Excel5::_GetInt2d怎么用?PHP PHPExcel_Reader_Excel5::_GetInt2d使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PHPExcel_Reader_Excel5
的用法示例。
在下文中一共展示了PHPExcel_Reader_Excel5::_GetInt2d方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _readOfficeArtRGFOPTE
/**
* Read OfficeArtRGFOPTE table of property-value pairs
*
* @param string $data Binary data
* @param int $n Number of properties
*/
private function _readOfficeArtRGFOPTE($data, $n)
{
$splicedComplexData = substr($data, 6 * $n);
// loop through property-value pairs
for ($i = 0; $i < $n; ++$i) {
// read 6 bytes at a time
$fopte = substr($data, 6 * $i, 6);
// offset: 0; size: 2; opid
$opid = PHPExcel_Reader_Excel5::_GetInt2d($fopte, 0);
// bit: 0-13; mask: 0x3FFF; opid.opid
$opidOpid = (0x3fff & $opid) >> 0;
// bit: 14; mask 0x4000; 1 = value in op field is BLIP identifier
$opidFBid = (0x4000 & $opid) >> 14;
// bit: 15; mask 0x8000; 1 = this is a complex property, op field specifies size of complex data
$opidFComplex = (0x8000 & $opid) >> 15;
// offset: 2; size: 4; the value for this property
$op = PHPExcel_Reader_Excel5::_GetInt4d($fopte, 2);
if ($opidFComplex) {
$complexData = substr($splicedComplexData, 0, $op);
$splicedComplexData = substr($splicedComplexData, $op);
// we store string value with complex data
$value = $complexData;
} else {
// we store integer value
$value = $op;
}
$this->_object->setOPT($opidOpid, $value);
}
}
示例2: _readDefault
/**
* Read a generic record
*/
private function _readDefault()
{
// offset 0; size: 2; recVer and recInstance
$verInstance = PHPExcel_Reader_Excel5::_GetInt2d($this->_data, $this->_pos);
// offset: 2; size: 2: Record Type
$fbt = PHPExcel_Reader_Excel5::_GetInt2d($this->_data, $this->_pos + 2);
// bit: 0-3; mask: 0x000F; recVer
$recVer = (0xf & $verInstance) >> 0;
$length = PHPExcel_Reader_Excel5::_GetInt4d($this->_data, $this->_pos + 4);
$recordData = substr($this->_data, $this->_pos + 8, $length);
// move stream pointer to next record
$this->_pos += 8 + $length;
}