tag/Mask: wrap in class
This commit is contained in:
@@ -27,6 +27,7 @@
|
||||
#include "client/Response.hxx"
|
||||
#include "Partition.hxx"
|
||||
#include "tag/Tag.hxx"
|
||||
#include "tag/Mask.hxx"
|
||||
#include "LightSong.hxx"
|
||||
#include "LightDirectory.hxx"
|
||||
#include "PlaylistInfo.hxx"
|
||||
@@ -202,7 +203,7 @@ PrintUniqueTag(Response &r, TagType tag_type,
|
||||
|
||||
void
|
||||
PrintUniqueTags(Response &r, Partition &partition,
|
||||
unsigned type, tag_mask_t group_mask,
|
||||
unsigned type, TagMask group_mask,
|
||||
const SongFilter *filter)
|
||||
{
|
||||
const Database &db = partition.GetDatabaseOrThrow();
|
||||
|
@@ -20,8 +20,7 @@
|
||||
#ifndef MPD_DB_PRINT_H
|
||||
#define MPD_DB_PRINT_H
|
||||
|
||||
#include "tag/Mask.hxx"
|
||||
|
||||
class TagMask;
|
||||
class SongFilter;
|
||||
struct DatabaseSelection;
|
||||
struct Partition;
|
||||
@@ -44,7 +43,7 @@ db_selection_print(Response &r, Partition &partition,
|
||||
|
||||
void
|
||||
PrintUniqueTags(Response &r, Partition &partition,
|
||||
unsigned type, tag_mask_t group_mask,
|
||||
unsigned type, TagMask group_mask,
|
||||
const SongFilter *filter);
|
||||
|
||||
#endif
|
||||
|
@@ -22,7 +22,6 @@
|
||||
|
||||
#include "Visitor.hxx"
|
||||
#include "tag/Type.h"
|
||||
#include "tag/Mask.hxx"
|
||||
#include "Compiler.h"
|
||||
|
||||
#include <time.h>
|
||||
@@ -31,6 +30,7 @@ struct DatabasePlugin;
|
||||
struct DatabaseStats;
|
||||
struct DatabaseSelection;
|
||||
struct LightSong;
|
||||
class TagMask;
|
||||
|
||||
class Database {
|
||||
const DatabasePlugin &plugin;
|
||||
@@ -103,7 +103,7 @@ public:
|
||||
* Visit all unique tag values.
|
||||
*/
|
||||
virtual void VisitUniqueTags(const DatabaseSelection &selection,
|
||||
TagType tag_type, tag_mask_t group_mask,
|
||||
TagType tag_type, TagMask group_mask,
|
||||
VisitTag visit_tag) const = 0;
|
||||
|
||||
gcc_pure
|
||||
|
@@ -21,13 +21,14 @@
|
||||
#include "Interface.hxx"
|
||||
#include "LightSong.hxx"
|
||||
#include "tag/Set.hxx"
|
||||
#include "tag/Mask.hxx"
|
||||
|
||||
#include <functional>
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
static void
|
||||
CollectTags(TagSet &set, TagType tag_type, tag_mask_t group_mask,
|
||||
CollectTags(TagSet &set, TagType tag_type, TagMask group_mask,
|
||||
const LightSong &song)
|
||||
{
|
||||
assert(song.tag != nullptr);
|
||||
@@ -38,7 +39,7 @@ CollectTags(TagSet &set, TagType tag_type, tag_mask_t group_mask,
|
||||
|
||||
void
|
||||
VisitUniqueTags(const Database &db, const DatabaseSelection &selection,
|
||||
TagType tag_type, tag_mask_t group_mask,
|
||||
TagType tag_type, TagMask group_mask,
|
||||
VisitTag visit_tag)
|
||||
{
|
||||
TagSet set;
|
||||
|
@@ -22,14 +22,14 @@
|
||||
|
||||
#include "Visitor.hxx"
|
||||
#include "tag/Type.h"
|
||||
#include "tag/Mask.hxx"
|
||||
|
||||
class TagMask;
|
||||
class Database;
|
||||
struct DatabaseSelection;
|
||||
|
||||
void
|
||||
VisitUniqueTags(const Database &db, const DatabaseSelection &selection,
|
||||
TagType tag_type, tag_mask_t group_mask,
|
||||
TagType tag_type, TagMask group_mask,
|
||||
VisitTag visit_tag);
|
||||
|
||||
#endif
|
||||
|
@@ -33,6 +33,7 @@
|
||||
#include "config/Block.hxx"
|
||||
#include "tag/Builder.hxx"
|
||||
#include "tag/Tag.hxx"
|
||||
#include "tag/Mask.hxx"
|
||||
#include "util/ScopeExit.hxx"
|
||||
#include "util/RuntimeError.hxx"
|
||||
#include "protocol/Ack.hxx"
|
||||
@@ -120,7 +121,7 @@ public:
|
||||
VisitPlaylist visit_playlist) const override;
|
||||
|
||||
void VisitUniqueTags(const DatabaseSelection &selection,
|
||||
TagType tag_type, tag_mask_t group_mask,
|
||||
TagType tag_type, TagMask group_mask,
|
||||
VisitTag visit_tag) const override;
|
||||
|
||||
DatabaseStats GetStats(const DatabaseSelection &selection) const override;
|
||||
@@ -756,7 +757,7 @@ ProxyDatabase::Visit(const DatabaseSelection &selection,
|
||||
void
|
||||
ProxyDatabase::VisitUniqueTags(const DatabaseSelection &selection,
|
||||
TagType tag_type,
|
||||
gcc_unused tag_mask_t group_mask,
|
||||
gcc_unused TagMask group_mask,
|
||||
VisitTag visit_tag) const
|
||||
{
|
||||
// TODO: eliminate the const_cast
|
||||
|
@@ -31,6 +31,7 @@
|
||||
#include "DatabaseSave.hxx"
|
||||
#include "db/DatabaseLock.hxx"
|
||||
#include "db/DatabaseError.hxx"
|
||||
#include "tag/Mask.hxx"
|
||||
#include "fs/io/TextFile.hxx"
|
||||
#include "fs/io/BufferedOutputStream.hxx"
|
||||
#include "fs/io/FileOutputStream.hxx"
|
||||
@@ -301,7 +302,7 @@ SimpleDatabase::Visit(const DatabaseSelection &selection,
|
||||
|
||||
void
|
||||
SimpleDatabase::VisitUniqueTags(const DatabaseSelection &selection,
|
||||
TagType tag_type, tag_mask_t group_mask,
|
||||
TagType tag_type, TagMask group_mask,
|
||||
VisitTag visit_tag) const
|
||||
{
|
||||
::VisitUniqueTags(*this, selection, tag_type, group_mask, visit_tag);
|
||||
|
@@ -120,7 +120,7 @@ public:
|
||||
VisitPlaylist visit_playlist) const override;
|
||||
|
||||
void VisitUniqueTags(const DatabaseSelection &selection,
|
||||
TagType tag_type, tag_mask_t group_mask,
|
||||
TagType tag_type, TagMask group_mask,
|
||||
VisitTag visit_tag) const override;
|
||||
|
||||
DatabaseStats GetStats(const DatabaseSelection &selection) const override;
|
||||
|
@@ -35,6 +35,7 @@
|
||||
#include "config/Block.hxx"
|
||||
#include "tag/Builder.hxx"
|
||||
#include "tag/Table.hxx"
|
||||
#include "tag/Mask.hxx"
|
||||
#include "fs/Traits.hxx"
|
||||
#include "Log.hxx"
|
||||
#include "SongFilter.hxx"
|
||||
@@ -88,7 +89,7 @@ public:
|
||||
VisitPlaylist visit_playlist) const override;
|
||||
|
||||
void VisitUniqueTags(const DatabaseSelection &selection,
|
||||
TagType tag_type, tag_mask_t group_mask,
|
||||
TagType tag_type, TagMask group_mask,
|
||||
VisitTag visit_tag) const override;
|
||||
|
||||
DatabaseStats GetStats(const DatabaseSelection &selection) const override;
|
||||
@@ -605,7 +606,7 @@ UpnpDatabase::Visit(const DatabaseSelection &selection,
|
||||
|
||||
void
|
||||
UpnpDatabase::VisitUniqueTags(const DatabaseSelection &selection,
|
||||
TagType tag, gcc_unused tag_mask_t group_mask,
|
||||
TagType tag, gcc_unused TagMask group_mask,
|
||||
VisitTag visit_tag) const
|
||||
{
|
||||
// TODO: use group_mask
|
||||
|
Reference in New Issue
Block a user