aboutsummaryrefslogtreecommitdiffstats
path: root/src/SongSticker.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-01-08 00:41:08 +0100
committerMax Kellermann <max@duempel.org>2014-01-08 00:41:08 +0100
commit6a953394f49eb4c36f2170b83bd4da9b681222e1 (patch)
tree2d17f6b901502eaf674a7aa082004696b04afc80 /src/SongSticker.cxx
parentc152a88ff60b0f3f2574860909edae20fdd8cf19 (diff)
downloadmpd-6a953394f49eb4c36f2170b83bd4da9b681222e1.tar.gz
mpd-6a953394f49eb4c36f2170b83bd4da9b681222e1.tar.xz
mpd-6a953394f49eb4c36f2170b83bd4da9b681222e1.zip
SongSticker: use Song references
Diffstat (limited to 'src/SongSticker.cxx')
-rw-r--r--src/SongSticker.cxx35
1 files changed, 15 insertions, 20 deletions
diff --git a/src/SongSticker.cxx b/src/SongSticker.cxx
index a0c4d3585..88bea1501 100644
--- a/src/SongSticker.cxx
+++ b/src/SongSticker.cxx
@@ -29,53 +29,48 @@
#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());
+ 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());
+ 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());
+ 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());
+ 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());
+ assert(song.IsInDatabase());
- const auto uri = song->GetURI();
+ const auto uri = song.GetURI();
return sticker_load("song", uri.c_str());
}