| 60 | } |
| 61 | |
| 62 | static DetachedSong |
| 63 | LoadQueueSong(LineReader &file, const char *line) |
| 64 | { |
| 65 | std::unique_ptr<DetachedSong> song; |
| 66 | |
| 67 | if (const char *p = StringAfterPrefix(line, SONG_BEGIN)) { |
| 68 | const char *uri = p; |
| 69 | return song_load(file, uri); |
| 70 | } else { |
| 71 | char *endptr; |
| 72 | long ret = strtol(line, &endptr, 10); |
| 73 | if (ret < 0 || *endptr != ':' || endptr[1] == 0) |
| 74 | throw std::runtime_error("Malformed playlist line in state file"); |
| 75 | |
| 76 | const char *uri = endptr + 1; |
| 77 | |
| 78 | return DetachedSong(uri); |
| 79 | } |
| 80 | } |
| 81 | |
| 82 | void |
| 83 | queue_load_song(LineReader &file, const SongLoader &loader, |
no test coverage detected