1 | <?php |
||
10 | abstract class Section |
||
11 | { |
||
12 | /** |
||
13 | * The parent CHM file. |
||
14 | * |
||
15 | * @var CHM |
||
16 | */ |
||
17 | protected $chm; |
||
18 | |||
19 | /** |
||
20 | * The offset of the section data. |
||
21 | * |
||
22 | * @var int |
||
23 | */ |
||
24 | protected $sectionOffset; |
||
25 | |||
26 | /** |
||
27 | * Initializes the instance. |
||
28 | * |
||
29 | * @param \CHMLib\CHM $chm The parent CHM file. |
||
30 | */ |
||
31 | 4 | public function __construct(CHM $chm) |
|
32 | { |
||
33 | 4 | $this->chm = $chm; |
|
34 | 4 | } |
|
35 | |||
36 | /** |
||
37 | * Return the (uncompressed) content. |
||
38 | * |
||
39 | * @param int $offset The position where the data starts (relative to the start of this section). |
||
40 | * @param int $length The length of the (compressed) data. |
||
41 | * |
||
42 | * @throws \Exception Throws an Exception in case of errors. |
||
43 | * |
||
44 | * @return string |
||
45 | */ |
||
46 | abstract public function getContents($offset, $length); |
||
47 | } |
||
48 |