diff options
Diffstat (limited to '')
-rw-r--r-- | src/SongSave.cxx (renamed from src/song_save.c) | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/song_save.c b/src/SongSave.cxx index 4fcb46e22..2b74d9354 100644 --- a/src/song_save.c +++ b/src/SongSave.cxx @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2011 The Music Player Daemon Project + * Copyright (C) 2003-2013 The Music Player Daemon Project * http://www.musicpd.org * * This program is free software; you can redistribute it and/or modify @@ -18,13 +18,16 @@ */ #include "config.h" -#include "song_save.h" +#include "SongSave.hxx" #include "song.h" -#include "tag_save.h" -#include "directory.h" +#include "TagSave.hxx" +#include "Directory.hxx" +#include "TextFile.hxx" #include "tag.h" -#include "text_file.h" + +extern "C" { #include "string_util.h" +} #include <glib.h> @@ -60,8 +63,8 @@ song_save(FILE *fp, const struct song *song) } struct song * -song_load(FILE *fp, struct directory *parent, const char *uri, - GString *buffer, GError **error_r) +song_load(TextFile &file, Directory *parent, const char *uri, + GError **error_r) { struct song *song = parent != NULL ? song_file_new(uri, parent) @@ -70,7 +73,7 @@ song_load(FILE *fp, struct directory *parent, const char *uri, enum tag_type type; const char *value; - while ((line = read_text_line(fp, buffer)) != NULL && + while ((line = file.ReadLine()) != NULL && strcmp(line, SONG_END) != 0) { colon = strchr(line, ':'); if (colon == NULL || colon == line) { |