aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-06-24 16:17:46 +0200
committerMax Kellermann <max@duempel.org>2013-06-24 16:17:46 +0200
commitef48eca9cac875f65622daf500bd702e20d666f3 (patch)
tree52fe455c347fd0f0ab14b471e2482c17c8aed5e6 /test
parent906d2fbadf075b7d8e3a5be7134a9bebb09b7285 (diff)
parente9e55b08127dc45b4c6045e1f42e34115086a521 (diff)
downloadmpd-ef48eca9cac875f65622daf500bd702e20d666f3.tar.gz
mpd-ef48eca9cac875f65622daf500bd702e20d666f3.tar.xz
mpd-ef48eca9cac875f65622daf500bd702e20d666f3.zip
Merge branch 'master' of git://git.musicpd.org/dk/mpd
Diffstat (limited to 'test')
-rw-r--r--test/dump_text_file.cxx22
1 files changed, 9 insertions, 13 deletions
diff --git a/test/dump_text_file.cxx b/test/dump_text_file.cxx
index 19502c7fd..40b3a878f 100644
--- a/test/dump_text_file.cxx
+++ b/test/dump_text_file.cxx
@@ -23,10 +23,7 @@
#include "InputStream.hxx"
#include "conf.h"
#include "stdbin.h"
-
-extern "C" {
-#include "text_input_stream.h"
-}
+#include "TextInputStream.hxx"
#ifdef ENABLE_ARCHIVE
#include "ArchiveList.hxx"
@@ -49,11 +46,11 @@ my_log_func(const gchar *log_domain, G_GNUC_UNUSED GLogLevelFlags log_level,
}
static void
-dump_text_file(struct text_input_stream *is)
+dump_text_file(TextInputStream &is)
{
- const char *line;
- while ((line = text_input_stream_read(is)) != NULL)
- printf("'%s'\n", line);
+ std::string line;
+ while (is.ReadLine(line))
+ printf("'%s'\n", line.c_str());
}
static int
@@ -77,11 +74,10 @@ dump_input_stream(struct input_stream *is)
/* read data and tags from the stream */
input_stream_unlock(is);
-
- struct text_input_stream *tis = text_input_stream_new(is);
- dump_text_file(tis);
- text_input_stream_free(tis);
-
+ {
+ TextInputStream tis(is);
+ dump_text_file(tis);
+ }
input_stream_lock(is);
if (!input_stream_check(is, &error)) {