aboutsummaryrefslogtreecommitdiffstats
path: root/src/PlaylistDatabase.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'src/PlaylistDatabase.cxx')
-rw-r--r--src/PlaylistDatabase.cxx19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/PlaylistDatabase.cxx b/src/PlaylistDatabase.cxx
index a6d15e755..3421ecb02 100644
--- a/src/PlaylistDatabase.cxx
+++ b/src/PlaylistDatabase.cxx
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2003-2013 The Music Player Daemon Project
+ * Copyright (C) 2003-2014 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
@@ -19,8 +19,9 @@
#include "config.h"
#include "PlaylistDatabase.hxx"
-#include "PlaylistVector.hxx"
-#include "TextFile.hxx"
+#include "db/PlaylistVector.hxx"
+#include "fs/io/TextFile.hxx"
+#include "fs/io/BufferedOutputStream.hxx"
#include "util/StringUtil.hxx"
#include "util/Error.hxx"
#include "util/Domain.hxx"
@@ -31,13 +32,13 @@
static constexpr Domain playlist_database_domain("playlist_database");
void
-playlist_vector_save(FILE *fp, const PlaylistVector &pv)
+playlist_vector_save(BufferedOutputStream &os, const PlaylistVector &pv)
{
for (const PlaylistInfo &pi : pv)
- fprintf(fp, PLAYLIST_META_BEGIN "%s\n"
- "mtime: %li\n"
- "playlist_end\n",
- pi.name.c_str(), (long)pi.mtime);
+ os.Format(PLAYLIST_META_BEGIN "%s\n"
+ "mtime: %li\n"
+ "playlist_end\n",
+ pi.name.c_str(), (long)pi.mtime);
}
bool
@@ -59,7 +60,7 @@ playlist_metadata_load(TextFile &file, PlaylistVector &pv, const char *name,
}
*colon++ = 0;
- value = strchug_fast(colon);
+ value = StripLeft(colon);
if (strcmp(line, "mtime") == 0)
pm.mtime = strtol(value, nullptr, 10);