tag/Mask: wrap in class

This commit is contained in:
Max Kellermann
2017-02-07 16:57:16 +01:00
parent 17097d96b7
commit 2f3f075e4f
16 changed files with 114 additions and 42 deletions

View File

@@ -29,6 +29,7 @@
#include "client/Client.hxx"
#include "client/Response.hxx"
#include "tag/ParseName.hxx"
#include "tag/Mask.hxx"
#include "util/ConstBuffer.hxx"
#include "util/StringAPI.hxx"
#include "SongFilter.hxx"
@@ -191,7 +192,7 @@ handle_list(Client &client, Request args, Response &r)
}
std::unique_ptr<SongFilter> filter;
tag_mask_t group_mask = 0;
TagMask group_mask = TagMask::None();
if (args.size == 1) {
/* for compatibility with < 0.12.0 */
@@ -216,7 +217,7 @@ handle_list(Client &client, Request args, Response &r)
return CommandResult::ERROR;
}
group_mask |= tag_mask_t(1) << unsigned(gt);
group_mask |= gt;
args.pop_back();
args.pop_back();
@@ -231,7 +232,7 @@ handle_list(Client &client, Request args, Response &r)
}
if (tagType < TAG_NUM_OF_ITEM_TYPES &&
group_mask & (tag_mask_t(1) << tagType)) {
group_mask.Test(TagType(tagType))) {
r.Error(ACK_ERROR_ARG, "Conflicting group");
return CommandResult::ERROR;
}