diff options
author | Max Kellermann <max@musicpd.org> | 2019-05-21 22:56:08 +0200 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2019-05-22 10:19:24 +0200 |
commit | 3fc4da382ea8006caea005179f421813624b9fc5 (patch) | |
tree | b1f41fc9487a138239593e3d2b9035504fced429 /src/db/plugins/simple | |
parent | 6ee7d88af0654d7305934511d190e7e788524845 (diff) |
db/simple/Song: allow LoadFile(), UpdateFile() to throw
Preparing to move logger calls out of lower-level libaries, and
propagating error details to the caller instead.
Diffstat (limited to 'src/db/plugins/simple')
-rw-r--r-- | src/db/plugins/simple/Song.hxx | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/db/plugins/simple/Song.hxx b/src/db/plugins/simple/Song.hxx index 23056cbbf..b37feef01 100644 --- a/src/db/plugins/simple/Song.hxx +++ b/src/db/plugins/simple/Song.hxx @@ -105,13 +105,23 @@ struct Song { * allocate a new song structure with a local file name and attempt to * load its metadata. If all decoder plugin fail to read its meta * data, nullptr is returned. + * + * Throws on error. + * + * @return the song on success, nullptr if the file was not + * recognized */ static SongPtr LoadFile(Storage &storage, const char *name_utf8, - Directory &parent) noexcept; + Directory &parent); void Free() noexcept; - bool UpdateFile(Storage &storage) noexcept; + /** + * Throws on error. + * + * @return true on success, false if the file was not recognized + */ + bool UpdateFile(Storage &storage); #ifdef ENABLE_ARCHIVE static SongPtr LoadFromArchive(ArchiveFile &archive, |