Captioning\Format\SBVFile::parse PHP Method

parse() public method

public parse ( )
    public function parse()
    {
        $matches = array();
        $res = preg_match_all(self::PATTERN, $this->fileContent, $matches);
        if (!$res || $res == 0) {
            throw new \Exception($this->filename . ' is not a proper .sbv file.');
        }
        $entries_count = count($matches[1]);
        for ($i = 0; $i < $entries_count; $i++) {
            $cue = new SBVCue($matches[1][$i], $matches[2][$i], $matches[3][$i]);
            $cue->setLineEnding($this->lineEnding);
            $this->addCue($cue);
        }
        return $this;
    }