diff options
Diffstat (limited to '')
-rw-r--r-- | src/DatabaseSelection.hxx (renamed from src/db_selection.h) | 26 | ||||
-rw-r--r-- | src/db/SimpleDatabasePlugin.cxx | 4 | ||||
-rw-r--r-- | src/db/SimpleDatabasePlugin.hxx | 2 |
3 files changed, 11 insertions, 21 deletions
diff --git a/src/db_selection.h b/src/DatabaseSelection.hxx index 002acdc73..3e5232288 100644 --- a/src/db_selection.h +++ b/src/DatabaseSelection.hxx @@ -17,18 +17,15 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef MPD_DB_SELECTION_H -#define MPD_DB_SELECTION_H +#ifndef MPD_DATABASE_SELECTION_HXX +#define MPD_DATABASE_SELECTION_HXX #include "gcc.h" #include <assert.h> #include <stddef.h> -struct directory; -struct song; - -struct db_selection { +struct DatabaseSelection { /** * The base URI of the search (UTF-8). Must not begin or end * with a slash. NULL or an empty string searches the whole @@ -40,18 +37,11 @@ struct db_selection { * Recursively search all sub directories? */ bool recursive; -}; -gcc_nonnull(1,2) -static inline void -db_selection_init(struct db_selection *selection, - const char *uri, bool recursive) -{ - assert(selection != NULL); - assert(uri != NULL); - - selection->uri = uri; - selection->recursive = recursive; -} + DatabaseSelection(const char *_uri, bool _recursive) + :uri(_uri), recursive(_recursive) { + assert(uri != NULL); + } +}; #endif diff --git a/src/db/SimpleDatabasePlugin.cxx b/src/db/SimpleDatabasePlugin.cxx index 0f0bedf54..e1cf0167b 100644 --- a/src/db/SimpleDatabasePlugin.cxx +++ b/src/db/SimpleDatabasePlugin.cxx @@ -19,10 +19,10 @@ #include "config.h" #include "SimpleDatabasePlugin.hxx" +#include "DatabaseSelection.hxx" extern "C" { #include "db_error.h" -#include "db_selection.h" #include "db_visitor.h" #include "db_save.h" #include "db_lock.h" @@ -237,7 +237,7 @@ SimpleDatabase::LookupDirectory(const char *uri) const } bool -SimpleDatabase::Visit(const db_selection &selection, +SimpleDatabase::Visit(const DatabaseSelection &selection, VisitDirectory visit_directory, VisitSong visit_song, VisitPlaylist visit_playlist, diff --git a/src/db/SimpleDatabasePlugin.hxx b/src/db/SimpleDatabasePlugin.hxx index d37738dd9..1e990de13 100644 --- a/src/db/SimpleDatabasePlugin.hxx +++ b/src/db/SimpleDatabasePlugin.hxx @@ -60,7 +60,7 @@ public: virtual void Close() override; virtual struct song *GetSong(const char *uri_utf8, GError **error_r) const override; - virtual bool Visit(const db_selection &selection, + virtual bool Visit(const DatabaseSelection &selection, VisitDirectory visit_directory, VisitSong visit_song, VisitPlaylist visit_playlist, |