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