Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: compiled/filter/Filter.cpp

Issue 29574591: Issue 5258 - Implement Filter::As<>() method to make working with filters easier from C++ code (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore
Patch Set: Removed unnecessary base class check Created Oct. 13, 2017, 4:57 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « compiled/filter/Filter.h ('k') | compiled/filter/InvalidFilter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: compiled/filter/Filter.cpp
===================================================================
--- a/compiled/filter/Filter.cpp
+++ b/compiled/filter/Filter.cpp
@@ -117,35 +117,35 @@ Filter* Filter::FromText(DependentString
{
knownFilter->second->AddRef();
return knownFilter->second;
}
FilterPtr filter;
switch (type)
{
- case Filter::Type::COMMENT:
+ case CommentFilter::classType:
filter = FilterPtr(new CommentFilter(text), false);
break;
- case Filter::Type::INVALID:
+ case InvalidFilter::classType:
filter = FilterPtr(new InvalidFilter(text, error), false);
break;
- case Filter::Type::BLOCKING:
+ case BlockingFilter::classType:
filter = FilterPtr(new BlockingFilter(text, data.regexp), false);
break;
- case Filter::Type::WHITELIST:
+ case WhitelistFilter::classType:
filter = FilterPtr(new WhitelistFilter(text, data.regexp), false);
break;
- case Filter::Type::ELEMHIDE:
+ case ElemHideFilter::classType:
filter = FilterPtr(new ElemHideFilter(text, data.elemhide), false);
break;
- case Filter::Type::ELEMHIDEEXCEPTION:
+ case ElemHideException::classType:
filter = FilterPtr(new ElemHideException(text, data.elemhide), false);
break;
- case Filter::Type::ELEMHIDEEMULATION:
+ case ElemHideEmulationFilter::classType:
filter = FilterPtr(new ElemHideEmulationFilter(text, data.elemhide), false);
if (static_cast<ElemHideEmulationFilter*>(filter.get())->IsGeneric())
filter = FilterPtr(new InvalidFilter(text, u"filter_elemhideemulation_nodomain"_str), false);
break;
default:
// This should never happen but just in case
return nullptr;
}
« no previous file with comments | « compiled/filter/Filter.h ('k') | compiled/filter/InvalidFilter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld