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.
This commit is contained in:
Max Kellermann
2019-05-21 22:56:08 +02:00
parent 6ee7d88af0
commit 3fc4da382e
3 changed files with 21 additions and 13 deletions

View File

@@ -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,