SongFilter: convert to a C++ class

This commit is contained in:
Max Kellermann
2012-08-29 19:27:03 +02:00
parent 04a9dec952
commit 333d226ed0
20 changed files with 210 additions and 241 deletions

View File

@@ -120,12 +120,12 @@ db_selection_print(struct client *client, const DatabaseSelection &selection,
return false;
using namespace std::placeholders;
const auto d = selection.match == nullptr
const auto d = selection.filter == nullptr
? std::bind(PrintDirectory, client, _1)
: VisitDirectory();
const auto s = std::bind(full ? PrintSongFull : PrintSongBrief,
client, _1);
const auto p = selection.match == nullptr
const auto p = selection.filter == nullptr
? std::bind(full ? PrintPlaylistFull : PrintPlaylistBrief,
client, _1, _2)
: VisitPlaylist();
@@ -155,14 +155,14 @@ stats_visitor_song(SearchStats &stats, song &song)
bool
searchStatsForSongsIn(struct client *client, const char *name,
const struct locate_item_list *criteria,
const SongFilter *filter,
GError **error_r)
{
const Database *db = GetDatabase(error_r);
if (db == nullptr)
return false;
const DatabaseSelection selection(name, true, criteria);
const DatabaseSelection selection(name, true, filter);
SearchStats stats;
stats.numberOfSongs = 0;
@@ -211,14 +211,14 @@ PrintUniqueTag(struct client *client, enum tag_type tag_type,
bool
listAllUniqueTags(struct client *client, int type,
const struct locate_item_list *criteria,
const SongFilter *filter,
GError **error_r)
{
const Database *db = GetDatabase(error_r);
if (db == nullptr)
return false;
const DatabaseSelection selection("", true, criteria);
const DatabaseSelection selection("", true, filter);
if (type == LOCATE_TAG_FILE_TYPE) {
using namespace std::placeholders;