| @@ 31-42 (lines=12) @@ | ||
| 28 | return $this->core->setLines($lines)->parse(); |
|
| 29 | } |
|
| 30 | ||
| 31 | public function dump($playlist) |
|
| 32 | { |
|
| 33 | $this->checkPlaylist($playlist); |
|
| 34 | ||
| 35 | $text = new TextStream(); |
|
| 36 | $lines = new Lines($text, new TagInfo); |
|
| 37 | ||
| 38 | $this->core->setLines($lines); |
|
| 39 | $this->core->dump($playlist); |
|
| 40 | ||
| 41 | return $text; |
|
| 42 | } |
|
| 43 | ||
| 44 | public function parseFromFile($path) |
|
| 45 | { |
|
| @@ 51-62 (lines=12) @@ | ||
| 48 | return $this->core->setLines($lines)->parse(); |
|
| 49 | } |
|
| 50 | ||
| 51 | public function dumpToFile($playlist, $path) |
|
| 52 | { |
|
| 53 | $this->checkPlaylist($playlist); |
|
| 54 | ||
| 55 | $file = new \SplFileObject($path); |
|
| 56 | $lines = new Lines(new FileStream($file, new TagInfo())); |
|
| 57 | ||
| 58 | $this->core->setLines($lines); |
|
| 59 | $this->core->dump($playlist); |
|
| 60 | ||
| 61 | return $file; |
|
| 62 | } |
|
| 63 | ||
| 64 | private function checkPlaylist($playlist) |
|
| 65 | { |
|