aboutsummaryrefslogtreecommitdiffstats
path: root/src/QueueSave.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-11-28 18:48:35 +0100
committerMax Kellermann <max@duempel.org>2013-11-28 18:48:35 +0100
commitaf4133e3c92c78cc19ff14b876be6afcab1db091 (patch)
treeda38387995bde630b20f81a717862ae21d19bb48 /src/QueueSave.cxx
parenta788b7e747bc21b9aadee45dd028fa6198af794e (diff)
downloadmpd-af4133e3c92c78cc19ff14b876be6afcab1db091.tar.gz
mpd-af4133e3c92c78cc19ff14b876be6afcab1db091.tar.xz
mpd-af4133e3c92c78cc19ff14b876be6afcab1db091.zip
Util/StringUtil: add StringStartsWith()
Replaces GLib's g_str_has_prefix().
Diffstat (limited to 'src/QueueSave.cxx')
-rw-r--r--src/QueueSave.cxx7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/QueueSave.cxx b/src/QueueSave.cxx
index 6a1a51992..af834090b 100644
--- a/src/QueueSave.cxx
+++ b/src/QueueSave.cxx
@@ -26,13 +26,12 @@
#include "DatabasePlugin.hxx"
#include "DatabaseGlue.hxx"
#include "TextFile.hxx"
+#include "util/StringUtil.hxx"
#include "util/UriUtil.hxx"
#include "util/Error.hxx"
#include "fs/Traits.hxx"
#include "Log.hxx"
-#include <glib.h>
-
#include <stdlib.h>
#define PRIO_LABEL "Prio: "
@@ -78,7 +77,7 @@ queue_load_song(TextFile &file, const char *line, queue &queue)
return;
uint8_t priority = 0;
- if (g_str_has_prefix(line, PRIO_LABEL)) {
+ if (StringStartsWith(line, PRIO_LABEL)) {
priority = strtoul(line + sizeof(PRIO_LABEL) - 1, nullptr, 10);
line = file.ReadLine();
@@ -89,7 +88,7 @@ queue_load_song(TextFile &file, const char *line, queue &queue)
const Database *db = nullptr;
Song *song;
- if (g_str_has_prefix(line, SONG_BEGIN)) {
+ if (StringStartsWith(line, SONG_BEGIN)) {
const char *uri = line + sizeof(SONG_BEGIN) - 1;
if (!uri_has_scheme(uri) && !PathTraits::IsAbsoluteUTF8(uri))
return;