From 204a1de3fd575deadda595b39799b9b9f6e7564e Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 12 Dec 2014 14:13:14 +0100 Subject: sticker/Database: use the Error library --- src/sticker/SongSticker.cxx | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) (limited to 'src/sticker/SongSticker.cxx') diff --git a/src/sticker/SongSticker.cxx b/src/sticker/SongSticker.cxx index b0b74b1a6..0b317bf9e 100644 --- a/src/sticker/SongSticker.cxx +++ b/src/sticker/SongSticker.cxx @@ -30,39 +30,41 @@ #include std::string -sticker_song_get_value(const LightSong &song, const char *name) +sticker_song_get_value(const LightSong &song, const char *name, Error &error) { const auto uri = song.GetURI(); - return sticker_load_value("song", uri.c_str(), name); + return sticker_load_value("song", uri.c_str(), name, error); } bool sticker_song_set_value(const LightSong &song, - const char *name, const char *value) + const char *name, const char *value, + Error &error) { const auto uri = song.GetURI(); - return sticker_store_value("song", uri.c_str(), name, value); + return sticker_store_value("song", uri.c_str(), name, value, error); } bool -sticker_song_delete(const LightSong &song) +sticker_song_delete(const LightSong &song, Error &error) { const auto uri = song.GetURI(); - return sticker_delete("song", uri.c_str()); + return sticker_delete("song", uri.c_str(), error); } bool -sticker_song_delete_value(const LightSong &song, const char *name) +sticker_song_delete_value(const LightSong &song, const char *name, + Error &error) { const auto uri = song.GetURI(); - return sticker_delete_value("song", uri.c_str(), name); + return sticker_delete_value("song", uri.c_str(), name, error); } struct sticker * -sticker_song_get(const LightSong &song) +sticker_song_get(const LightSong &song, Error &error) { const auto uri = song.GetURI(); - return sticker_load("song", uri.c_str()); + return sticker_load("song", uri.c_str(), error); } struct sticker_song_find_data { @@ -97,7 +99,8 @@ bool sticker_song_find(const Database &db, const char *base_uri, const char *name, void (*func)(const LightSong &song, const char *value, void *user_data), - void *user_data) + void *user_data, + Error &error) { struct sticker_song_find_data data; data.db = &db; @@ -117,7 +120,8 @@ sticker_song_find(const Database &db, const char *base_uri, const char *name, data.base_uri_length = strlen(data.base_uri); bool success = sticker_find("song", data.base_uri, name, - sticker_song_find_cb, &data); + sticker_song_find_cb, &data, + error); free(allocated); return success; -- cgit v1.2.3