aboutsummaryrefslogtreecommitdiffstats
path: root/src/playlist/CuePlaylistPlugin.cxx
diff options
context:
space:
mode:
authorDenis Krjuchkov <denis@crazydev.net>2013-05-12 20:02:27 +0600
committerDenis Krjuchkov <denis@crazydev.net>2013-05-12 20:02:27 +0600
commite9e55b08127dc45b4c6045e1f42e34115086a521 (patch)
treec79558219a5605584dc6c81cc1dea348afdf3d75 /src/playlist/CuePlaylistPlugin.cxx
parent49a3845135142ada6d581d5a6f4a5192aaed49be (diff)
downloadmpd-e9e55b08127dc45b4c6045e1f42e34115086a521.tar.gz
mpd-e9e55b08127dc45b4c6045e1f42e34115086a521.tar.xz
mpd-e9e55b08127dc45b4c6045e1f42e34115086a521.zip
text_input_stream: convert to class
Diffstat (limited to 'src/playlist/CuePlaylistPlugin.cxx')
-rw-r--r--src/playlist/CuePlaylistPlugin.cxx16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/playlist/CuePlaylistPlugin.cxx b/src/playlist/CuePlaylistPlugin.cxx
index 730ef783b..3d8098672 100644
--- a/src/playlist/CuePlaylistPlugin.cxx
+++ b/src/playlist/CuePlaylistPlugin.cxx
@@ -24,10 +24,7 @@
#include "song.h"
#include "input_stream.h"
#include "cue/CueParser.hxx"
-
-extern "C" {
-#include "text_input_stream.h"
-}
+#include "TextInputStream.hxx"
#include <glib.h>
#include <assert.h>
@@ -40,16 +37,15 @@ struct CuePlaylist {
struct playlist_provider base;
struct input_stream *is;
- struct text_input_stream *tis;
+ TextInputStream tis;
CueParser parser;
CuePlaylist(struct input_stream *_is)
- :is(_is), tis(text_input_stream_new(is)) {
+ :is(_is), tis(is) {
playlist_provider_init(&base, &cue_playlist_plugin);
}
~CuePlaylist() {
- text_input_stream_free(tis);
}
};
@@ -76,9 +72,9 @@ cue_playlist_read(struct playlist_provider *_playlist)
if (song != NULL)
return song;
- const char *line;
- while ((line = text_input_stream_read(playlist->tis)) != NULL) {
- playlist->parser.Feed(line);
+ std::string line;
+ while (playlist->tis.ReadLine(line)) {
+ playlist->parser.Feed(line.c_str());
song = playlist->parser.Get();
if (song != NULL)
return song;