aboutsummaryrefslogtreecommitdiffstats
path: root/src/SongSave.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-07-28 13:25:12 +0200
committerMax Kellermann <max@duempel.org>2013-07-28 13:25:12 +0200
commitba161ec572b98d3bcf9f735ff122133319fe896a (patch)
treea211690e3a8b7fce1fb6db540228122bead1f2bc /src/SongSave.cxx
parent43f613d9be9aa2953dcfc0aacfbdfb56d5d1a708 (diff)
downloadmpd-ba161ec572b98d3bcf9f735ff122133319fe896a.tar.gz
mpd-ba161ec572b98d3bcf9f735ff122133319fe896a.tar.xz
mpd-ba161ec572b98d3bcf9f735ff122133319fe896a.zip
song: convert header to C++
Diffstat (limited to 'src/SongSave.cxx')
-rw-r--r--src/SongSave.cxx16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/SongSave.cxx b/src/SongSave.cxx
index c3796235b..d6860d1b0 100644
--- a/src/SongSave.cxx
+++ b/src/SongSave.cxx
@@ -19,7 +19,7 @@
#include "config.h"
#include "SongSave.hxx"
-#include "song.h"
+#include "Song.hxx"
#include "TagSave.hxx"
#include "Directory.hxx"
#include "TextFile.hxx"
@@ -43,7 +43,7 @@ song_save_quark(void)
}
void
-song_save(FILE *fp, const struct song *song)
+song_save(FILE *fp, const Song *song)
{
fprintf(fp, SONG_BEGIN "%s\n", song->uri);
@@ -59,13 +59,13 @@ song_save(FILE *fp, const struct song *song)
fprintf(fp, SONG_END "\n");
}
-struct song *
+Song *
song_load(TextFile &file, Directory *parent, const char *uri,
GError **error_r)
{
- struct song *song = parent != NULL
- ? song_file_new(uri, parent)
- : song_remote_new(uri);
+ Song *song = parent != NULL
+ ? Song::NewFile(uri, parent)
+ : Song::NewRemote(uri);
char *line, *colon;
enum tag_type type;
const char *value;
@@ -76,7 +76,7 @@ song_load(TextFile &file, Directory *parent, const char *uri,
if (colon == NULL || colon == line) {
if (song->tag != NULL)
tag_end_add(song->tag);
- song_free(song);
+ song->Free();
g_set_error(error_r, song_save_quark(), 0,
"unknown line in db: %s", line);
@@ -118,7 +118,7 @@ song_load(TextFile &file, Directory *parent, const char *uri,
} else {
if (song->tag != NULL)
tag_end_add(song->tag);
- song_free(song);
+ song->Free();
g_set_error(error_r, song_save_quark(), 0,
"unknown line in db: %s", line);