diff options
Diffstat (limited to 'src/SongSticker.cxx')
-rw-r--r-- | src/SongSticker.cxx | 37 |
1 files changed, 11 insertions, 26 deletions
diff --git a/src/SongSticker.cxx b/src/SongSticker.cxx index a0c4d3585..8c5499bc2 100644 --- a/src/SongSticker.cxx +++ b/src/SongSticker.cxx @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2013 The Music Player Daemon Project + * Copyright (C) 2003-2014 The Music Player Daemon Project * http://www.musicpd.org * * This program is free software; you can redistribute it and/or modify @@ -29,53 +29,38 @@ #include <string.h> std::string -sticker_song_get_value(const Song *song, const char *name) +sticker_song_get_value(const Song &song, const char *name) { - assert(song != nullptr); - assert(song->IsInDatabase()); - - const auto uri = song->GetURI(); + const auto uri = song.GetURI(); return sticker_load_value("song", uri.c_str(), name); } bool -sticker_song_set_value(const Song *song, +sticker_song_set_value(const Song &song, const char *name, const char *value) { - assert(song != nullptr); - assert(song->IsInDatabase()); - - const auto uri = song->GetURI(); + const auto uri = song.GetURI(); return sticker_store_value("song", uri.c_str(), name, value); } bool -sticker_song_delete(const Song *song) +sticker_song_delete(const Song &song) { - assert(song != nullptr); - assert(song->IsInDatabase()); - - const auto uri = song->GetURI(); + const auto uri = song.GetURI(); return sticker_delete("song", uri.c_str()); } bool -sticker_song_delete_value(const Song *song, const char *name) +sticker_song_delete_value(const Song &song, const char *name) { - assert(song != nullptr); - assert(song->IsInDatabase()); - - const auto uri = song->GetURI(); + const auto uri = song.GetURI(); return sticker_delete_value("song", uri.c_str(), name); } struct sticker * -sticker_song_get(const Song *song) +sticker_song_get(const Song &song) { - assert(song != nullptr); - assert(song->IsInDatabase()); - - const auto uri = song->GetURI(); + const auto uri = song.GetURI(); return sticker_load("song", uri.c_str()); } |