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