From ba161ec572b98d3bcf9f735ff122133319fe896a Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sun, 28 Jul 2013 13:25:12 +0200 Subject: song: convert header to C++ --- src/SongSave.cxx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/SongSave.cxx') 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); -- cgit v1.2.3