protected function readSectionSize(SeekableIterator $it) { $it->seek($this->start_line); if (!$it->valid()) { throw new phpMorphy_Mrd_Exception("Can`t read section size, iterator not valid"); } $size = trim($it->current()); if (!preg_match('~^[0-9]+$~', $size)) { throw new phpMorphy_Mrd_Exception("Invalid section size: {$size}"); } return (int) $size; }
/** * Tests to see if pointer is valid. */ public function valid() { return $this->iterator->valid(); }