| Index: compiled/subscription/UserDefinedSubscription.cpp |
| =================================================================== |
| --- a/compiled/subscription/UserDefinedSubscription.cpp |
| +++ b/compiled/subscription/UserDefinedSubscription.cpp |
| @@ -65,16 +65,33 @@ void UserDefinedSubscription::MakeDefaul |
| if (filter->mType >= Filter::Type::VALUE_COUNT) |
| { |
| assert(false, "Filter type exceeds valid range"); |
| abort(); |
| } |
| mDefaults |= filterTypeToCategory[filter->mType]; |
| } |
| +void UserDefinedSubscription::InsertFilterAt(Filter* filter, unsigned pos) |
| +{ |
| + if (pos >= mFilters.size()) |
| + mFilters.emplace_back(filter); |
| + else |
| + mFilters.emplace(mFilters.begin() + pos, filter); |
| +} |
| + |
| +bool UserDefinedSubscription::RemoveFilterAt(unsigned pos) |
| +{ |
| + if (pos >= mFilters.size()) |
| + return false; |
| + |
| + mFilters.erase(mFilters.begin() + pos); |
| + return true; |
| +} |
| + |
| OwnedString UserDefinedSubscription::Serialize() const |
| { |
| OwnedString result(Subscription::Serialize()); |
| if (mDefaults) |
| { |
| result.append(u"defaults="_str); |
| if (mDefaults & FilterCategory::BLOCKING) |
| result.append(u" blocking"_str); |