From b3d76b7e5c46ff46139457b3aa910d92e290f38f Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 7 Aug 2012 23:10:34 +0200 Subject: db_print.h: rename to DatabasePrint.hxx --- Makefile.am | 3 +- src/DatabaseCommands.cxx | 4 +-- src/DatabasePrint.cxx | 10 +++---- src/DatabasePrint.hxx | 71 ++++++++++++++++++++++++++++++++++++++++++++++++ src/db_print.h | 71 ------------------------------------------------ 5 files changed, 79 insertions(+), 80 deletions(-) create mode 100644 src/DatabasePrint.hxx delete mode 100644 src/db_print.h diff --git a/Makefile.am b/Makefile.am index 38750eed8..7b4f11d9a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -253,13 +253,12 @@ src_mpd_SOURCES = \ src/Directory.cxx \ src/directory_save.c \ src/DatabaseGlue.cxx \ - src/DatabasePrint.cxx \ + src/DatabasePrint.cxx src/DatabasePrint.hxx \ src/DatabaseQueue.cxx src/DatabaseQueue.hxx \ src/DatabasePlaylist.cxx src/DatabasePlaylist.hxx \ src/db_error.h \ src/db_lock.c src/db_lock.h \ src/db_save.c src/db_save.h \ - src/db_print.h \ src/db_visitor.h \ src/DatabasePlugin.hxx \ src/DatabaseVisitor.hxx \ diff --git a/src/DatabaseCommands.cxx b/src/DatabaseCommands.cxx index aa485ece3..f2f9c4885 100644 --- a/src/DatabaseCommands.cxx +++ b/src/DatabaseCommands.cxx @@ -21,13 +21,13 @@ #include "DatabaseCommands.hxx" #include "DatabaseQueue.hxx" #include "DatabasePlaylist.hxx" +#include "DatabasePrint.hxx" #include "CommandError.h" #include "client_internal.h" #include "tag.h" #include "uri.h" extern "C" { -#include "db_print.h" #include "db_selection.h" #include "locate.h" #include "protocol/result.h" @@ -51,7 +51,7 @@ handle_lsinfo2(struct client *client, int argc, char *argv[]) db_selection_init(&selection, uri, false); GError *error = NULL; - if (!db_selection_print(client, &selection, true, &error)) + if (!db_selection_print(client, selection, true, &error)) return print_error(client, error); return COMMAND_RETURN_OK; diff --git a/src/DatabasePrint.cxx b/src/DatabasePrint.cxx index 258637535..b8f6d6f49 100644 --- a/src/DatabasePrint.cxx +++ b/src/DatabasePrint.cxx @@ -18,9 +18,9 @@ */ #include "config.h" +#include "DatabasePrint.hxx" extern "C" { -#include "db_print.h" #include "db_selection.h" #include "locate.h" #include "database.h" @@ -125,7 +125,7 @@ PrintPlaylistFull(struct client *client, } bool -db_selection_print(struct client *client, const struct db_selection *selection, +db_selection_print(struct client *client, const db_selection &selection, bool full, GError **error_r) { using namespace std::placeholders; @@ -135,7 +135,7 @@ db_selection_print(struct client *client, const struct db_selection *selection, const auto p = std::bind(full ? PrintPlaylistFull : PrintPlaylistBrief, client, _1, _2); - return GetDatabase()->Visit(*selection, d, s, p, error_r); + return GetDatabase()->Visit(selection, d, s, p, error_r); } static bool @@ -241,7 +241,7 @@ printAllIn(struct client *client, const char *uri_utf8, GError **error_r) { struct db_selection selection; db_selection_init(&selection, uri_utf8, true); - return db_selection_print(client, &selection, false, error_r); + return db_selection_print(client, selection, false, error_r); } bool @@ -250,7 +250,7 @@ printInfoForAllIn(struct client *client, const char *uri_utf8, { struct db_selection selection; db_selection_init(&selection, uri_utf8, true); - return db_selection_print(client, &selection, true, error_r); + return db_selection_print(client, selection, true, error_r); } struct StringLess { diff --git a/src/DatabasePrint.hxx b/src/DatabasePrint.hxx new file mode 100644 index 000000000..65e0c988c --- /dev/null +++ b/src/DatabasePrint.hxx @@ -0,0 +1,71 @@ +/* + * Copyright (C) 2003-2011 The Music Player Daemon Project + * http://www.musicpd.org + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#ifndef MPD_DB_PRINT_H +#define MPD_DB_PRINT_H + +#include "gcc.h" +#include "gerror.h" + +#include + +struct client; +struct locate_item_list; +struct db_selection; +struct db_visitor; + +gcc_nonnull(1) +bool +db_selection_print(struct client *client, const db_selection &selection, + bool full, GError **error_r); + +gcc_nonnull(1,2) +bool +printAllIn(struct client *client, const char *uri_utf8, GError **error_r); + +gcc_nonnull(1,2) +bool +printInfoForAllIn(struct client *client, const char *uri_utf8, + GError **error_r); + +gcc_nonnull(1,2,3) +bool +searchForSongsIn(struct client *client, const char *name, + const struct locate_item_list *criteria, + GError **error_r); + +gcc_nonnull(1,2,3) +bool +findSongsIn(struct client *client, const char *name, + const struct locate_item_list *criteria, + GError **error_r); + +gcc_nonnull(1,2,3) +bool +searchStatsForSongsIn(struct client *client, const char *name, + const struct locate_item_list *criteria, + GError **error_r); + +gcc_nonnull(1,3) +bool +listAllUniqueTags(struct client *client, int type, + const struct locate_item_list *criteria, + GError **error_r); + +#endif diff --git a/src/db_print.h b/src/db_print.h deleted file mode 100644 index 078d4e582..000000000 --- a/src/db_print.h +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright (C) 2003-2011 The Music Player Daemon Project - * http://www.musicpd.org - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#ifndef MPD_DB_PRINT_H -#define MPD_DB_PRINT_H - -#include "gcc.h" -#include "gerror.h" - -#include - -struct client; -struct locate_item_list; -struct db_selection; -struct db_visitor; - -gcc_nonnull(1,2) -bool -db_selection_print(struct client *client, const struct db_selection *selection, - bool full, GError **error_r); - -gcc_nonnull(1,2) -bool -printAllIn(struct client *client, const char *uri_utf8, GError **error_r); - -gcc_nonnull(1,2) -bool -printInfoForAllIn(struct client *client, const char *uri_utf8, - GError **error_r); - -gcc_nonnull(1,2,3) -bool -searchForSongsIn(struct client *client, const char *name, - const struct locate_item_list *criteria, - GError **error_r); - -gcc_nonnull(1,2,3) -bool -findSongsIn(struct client *client, const char *name, - const struct locate_item_list *criteria, - GError **error_r); - -gcc_nonnull(1,2,3) -bool -searchStatsForSongsIn(struct client *client, const char *name, - const struct locate_item_list *criteria, - GError **error_r); - -gcc_nonnull(1,3) -bool -listAllUniqueTags(struct client *client, int type, - const struct locate_item_list *criteria, - GError **error_r); - -#endif -- cgit v1.2.3