diff options
author | Max Kellermann <max@duempel.org> | 2013-07-30 20:11:57 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2013-07-30 20:19:53 +0200 |
commit | 06f898cc1240a29b293de0e97ad95a4fdc971254 (patch) | |
tree | 001a6d3db039cdc03323f3bfddc13b94bde31ce4 /src/SongSave.cxx | |
parent | 6a9ab8bc0e2f5d34803513bb2d94d041a607a58c (diff) | |
download | mpd-06f898cc1240a29b293de0e97ad95a4fdc971254.tar.gz mpd-06f898cc1240a29b293de0e97ad95a4fdc971254.tar.xz mpd-06f898cc1240a29b293de0e97ad95a4fdc971254.zip |
tag: convert to C++
Diffstat (limited to 'src/SongSave.cxx')
-rw-r--r-- | src/SongSave.cxx | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/SongSave.cxx b/src/SongSave.cxx index d6860d1b0..fcad320df 100644 --- a/src/SongSave.cxx +++ b/src/SongSave.cxx @@ -23,7 +23,7 @@ #include "TagSave.hxx" #include "Directory.hxx" #include "TextFile.hxx" -#include "tag.h" +#include "Tag.hxx" #include "util/StringUtil.hxx" #include <glib.h> @@ -52,8 +52,8 @@ song_save(FILE *fp, const Song *song) else if (song->start_ms > 0) fprintf(fp, "Range: %u-\n", song->start_ms); - if (song->tag != NULL) - tag_save(fp, song->tag); + if (song->tag != nullptr) + tag_save(fp, *song->tag); fprintf(fp, SONG_MTIME ": %li\n", (long)song->mtime); fprintf(fp, SONG_END "\n"); @@ -75,7 +75,7 @@ song_load(TextFile &file, Directory *parent, const char *uri, colon = strchr(line, ':'); if (colon == NULL || colon == line) { if (song->tag != NULL) - tag_end_add(song->tag); + song->tag->EndAdd(); song->Free(); g_set_error(error_r, song_save_quark(), 0, @@ -88,22 +88,22 @@ song_load(TextFile &file, Directory *parent, const char *uri, if ((type = tag_name_parse(line)) != TAG_NUM_OF_ITEM_TYPES) { if (!song->tag) { - song->tag = tag_new(); - tag_begin_add(song->tag); + song->tag = new Tag(); + song->tag->BeginAdd(); } - tag_add_item(song->tag, type, value); + song->tag->AddItem(type, value); } else if (strcmp(line, "Time") == 0) { if (!song->tag) { - song->tag = tag_new(); - tag_begin_add(song->tag); + song->tag = new Tag(); + song->tag->BeginAdd(); } song->tag->time = atoi(value); } else if (strcmp(line, "Playlist") == 0) { if (!song->tag) { - song->tag = tag_new(); - tag_begin_add(song->tag); + song->tag = new Tag(); + song->tag->BeginAdd(); } song->tag->has_playlist = strcmp(value, "yes") == 0; @@ -117,7 +117,7 @@ song_load(TextFile &file, Directory *parent, const char *uri, song->end_ms = strtoul(endptr + 1, NULL, 10); } else { if (song->tag != NULL) - tag_end_add(song->tag); + song->tag->EndAdd(); song->Free(); g_set_error(error_r, song_save_quark(), 0, @@ -127,7 +127,7 @@ song_load(TextFile &file, Directory *parent, const char *uri, } if (song->tag != NULL) - tag_end_add(song->tag); + song->tag->EndAdd(); return song; } |