Instance: add GetDatabaseOrThrow()

This commit is contained in:
Max Kellermann
2016-10-26 18:47:19 +02:00
parent 6135f0763b
commit 086652dd50
12 changed files with 65 additions and 40 deletions

View File

@@ -110,6 +110,14 @@ struct Instance final
* music_directory was configured).
*/
Database *GetDatabase(Error &error);
/**
* Returns the global #Database instance. Throws
* DatabaseError if this MPD configuration has no database (no
* music_directory was configured).
*/
gcc_pure
const Database &GetDatabaseOrThrow() const;
#endif
private: