From 154e601f4e99e5334005279eb64ba6a541d9e844 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 25 Apr 2014 18:39:21 +0200 Subject: db/Helpers: split library --- src/db/Helpers.cxx | 36 ------------------------------------ 1 file changed, 36 deletions(-) (limited to 'src/db/Helpers.cxx') diff --git a/src/db/Helpers.cxx b/src/db/Helpers.cxx index 5b1e1d6c6..b849e73e8 100644 --- a/src/db/Helpers.cxx +++ b/src/db/Helpers.cxx @@ -22,13 +22,9 @@ #include "Interface.hxx" #include "LightSong.hxx" #include "tag/Tag.hxx" -#include "tag/TagBuilder.hxx" -#include "tag/Set.hxx" -#include #include -#include #include struct StringLess { @@ -40,38 +36,6 @@ struct StringLess { typedef std::set StringSet; -static bool -CollectTags(TagSet &set, TagType tag_type, uint32_t group_mask, - const LightSong &song) -{ - assert(song.tag != nullptr); - const Tag &tag = *song.tag; - - set.InsertUnique(tag, tag_type, group_mask); - return true; -} - -bool -VisitUniqueTags(const Database &db, const DatabaseSelection &selection, - TagType tag_type, uint32_t group_mask, - VisitTag visit_tag, - Error &error) -{ - TagSet set; - - using namespace std::placeholders; - const auto f = std::bind(CollectTags, std::ref(set), - tag_type, group_mask, _1); - if (!db.Visit(selection, f, error)) - return false; - - for (const auto &value : set) - if (!visit_tag(value, error)) - return false; - - return true; -} - static void StatsVisitTag(DatabaseStats &stats, StringSet &artists, StringSet &albums, const Tag &tag) -- cgit v1.2.3