filename = $conf['indexdir'] . '/' . $idx . $suffix . '.idx'; $this->idx = $idx; $this->suffix = $suffix; } /** * @return string the full path to the underlying file */ public function getFilename() { return $this->filename; } /** * Change a line in the index * * If the line doesn't exist, it will be added, creating empty * lines inbetween as necessary * * @param int $rid the line number, count starting at 0 * @param string $value line content to write */ abstract public function changeRow($rid, $value); /** * Retrieve a line from the index * * Returns an empty string for non-existing lines * * @param int $rid the line number * @return string a line with trailing whitespace removed */ abstract public function retrieveRow($rid); /** * Clears the index by deleting its file * @return void */ public function clear() { @unlink($this->filename); } }