aboutsummaryrefslogtreecommitdiffstats
path: root/src/sticker/SongSticker.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-12-12 14:13:14 +0100
committerMax Kellermann <max@duempel.org>2014-12-12 21:43:54 +0100
commit204a1de3fd575deadda595b39799b9b9f6e7564e (patch)
tree7a629e8ed916d21a16a0b7e373a5d07d85869bb3 /src/sticker/SongSticker.cxx
parent80ddf4aecf2b865e4d4bb5f9f621b51c34a44122 (diff)
downloadmpd-204a1de3fd575deadda595b39799b9b9f6e7564e.tar.gz
mpd-204a1de3fd575deadda595b39799b9b9f6e7564e.tar.xz
mpd-204a1de3fd575deadda595b39799b9b9f6e7564e.zip
sticker/Database: use the Error library
Diffstat (limited to '')
-rw-r--r--src/sticker/SongSticker.cxx28
1 files changed, 16 insertions, 12 deletions
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 <stdlib.h>
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;