Read the file.
79 if(!is_readable($sFileName)) {
80 throw new PHPExcel_Reader_Exception(
"Could not open " . $sFileName .
" for reading! File does not exist, or it is not readable.");
85 $this->
data = file_get_contents($sFileName, FALSE, NULL, 0, 8);
88 if ($this->
data != self::IDENTIFIER_OLE) {
93 $this->
data = file_get_contents($sFileName);
96 $this->numBigBlockDepotBlocks = self::_GetInt4d($this->
data, self::NUM_BIG_BLOCK_DEPOT_BLOCKS_POS);
99 $this->rootStartBlock = self::_GetInt4d($this->
data, self::ROOT_START_BLOCK_POS);
102 $this->sbdStartBlock = self::_GetInt4d($this->
data, self::SMALL_BLOCK_DEPOT_BLOCK_POS);
105 $this->extensionBlock = self::_GetInt4d($this->
data, self::EXTENSION_BLOCK_POS);
108 $this->numExtensionBlocks = self::_GetInt4d($this->
data, self::NUM_EXTENSION_BLOCK_POS);
110 $bigBlockDepotBlocks =
array();
111 $pos = self::BIG_BLOCK_DEPOT_BLOCKS_POS;
113 $bbdBlocks = $this->numBigBlockDepotBlocks;
115 if ($this->numExtensionBlocks != 0) {
116 $bbdBlocks = (self::BIG_BLOCK_SIZE - self::BIG_BLOCK_DEPOT_BLOCKS_POS)/4;
119 for ($i = 0; $i < $bbdBlocks; ++$i) {
120 $bigBlockDepotBlocks[$i] = self::_GetInt4d($this->
data, $pos);
124 for ($j = 0; $j < $this->numExtensionBlocks; ++$j) {
125 $pos = ($this->extensionBlock + 1) * self::BIG_BLOCK_SIZE;
126 $blocksToRead = min($this->numBigBlockDepotBlocks - $bbdBlocks, self::BIG_BLOCK_SIZE / 4 - 1);
128 for ($i = $bbdBlocks; $i < $bbdBlocks + $blocksToRead; ++$i) {
129 $bigBlockDepotBlocks[$i] = self::_GetInt4d($this->
data, $pos);
133 $bbdBlocks += $blocksToRead;
134 if ($bbdBlocks < $this->numBigBlockDepotBlocks) {
135 $this->extensionBlock = self::_GetInt4d($this->
data, $pos);
140 $this->bigBlockChain =
'';
141 $bbs = self::BIG_BLOCK_SIZE / 4;
142 for ($i = 0; $i < $this->numBigBlockDepotBlocks; ++$i) {
143 $pos = ($bigBlockDepotBlocks[$i] + 1) * self::BIG_BLOCK_SIZE;
145 $this->bigBlockChain .= substr($this->
data, $pos, 4*$bbs);
150 $sbdBlock = $this->sbdStartBlock;
151 $this->smallBlockChain =
'';
152 while ($sbdBlock != -2) {
153 $pos = ($sbdBlock + 1) * self::BIG_BLOCK_SIZE;
155 $this->smallBlockChain .= substr($this->
data, $pos, 4*$bbs);
158 $sbdBlock = self::_GetInt4d($this->bigBlockChain, $sbdBlock*4);
162 $block = $this->rootStartBlock;
_readData($bl)
Read a standard stream (by joining sectors using information from SAT)
Create styles array
The data for the language used.
_readPropertySets()
Read entries in the directory stream.