input/TextInputStream: return char*
Revert to the old API before commit e9e55b08
, removing unnecessary
bloat.
This commit is contained in:
@@ -52,9 +52,9 @@ CuePlaylist::NextSong()
|
||||
if (song != nullptr)
|
||||
return song;
|
||||
|
||||
std::string line;
|
||||
while (tis.ReadLine(line)) {
|
||||
parser.Feed(line.c_str());
|
||||
const char *line;
|
||||
while ((line = tis.ReadLine()) != nullptr) {
|
||||
parser.Feed(line);
|
||||
song = parser.Get();
|
||||
if (song != nullptr)
|
||||
return song;
|
||||
|
@@ -39,9 +39,8 @@ public:
|
||||
}
|
||||
|
||||
bool CheckFirstLine() {
|
||||
std::string line;
|
||||
return tis.ReadLine(line) &&
|
||||
strcmp(line.c_str(), "#EXTM3U") == 0;
|
||||
const char *line = tis.ReadLine();
|
||||
return line != nullptr && strcmp(line, "#EXTM3U") == 0;
|
||||
}
|
||||
|
||||
virtual DetachedSong *NextSong() override;
|
||||
@@ -105,15 +104,13 @@ DetachedSong *
|
||||
ExtM3uPlaylist::NextSong()
|
||||
{
|
||||
Tag tag;
|
||||
std::string line;
|
||||
const char *line_s;
|
||||
|
||||
do {
|
||||
if (!tis.ReadLine(line))
|
||||
line_s = tis.ReadLine();
|
||||
if (line_s == nullptr)
|
||||
return nullptr;
|
||||
|
||||
line_s = line.c_str();
|
||||
|
||||
if (StringStartsWith(line_s, "#EXTINF:")) {
|
||||
tag = extm3u_parse_tag(line_s + 8);
|
||||
continue;
|
||||
|
@@ -45,14 +45,13 @@ m3u_open_stream(InputStream &is)
|
||||
DetachedSong *
|
||||
M3uPlaylist::NextSong()
|
||||
{
|
||||
std::string line;
|
||||
const char *line_s;
|
||||
|
||||
do {
|
||||
if (!tis.ReadLine(line))
|
||||
line_s = tis.ReadLine();
|
||||
if (line_s == nullptr)
|
||||
return nullptr;
|
||||
|
||||
line_s = line.c_str();
|
||||
line_s = strchug_fast(line_s);
|
||||
} while (line_s[0] == '#' || *line_s == 0);
|
||||
|
||||
|
Reference in New Issue
Block a user