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

Unified Diff: compiled/RegExpFilter.h

Issue 29333474: Issue 4125 - [emscripten] Convert filter classes to C++ (Closed)
Patch Set: Almost complete implementation, missing CSS property filters Created Jan. 20, 2016, 12:04 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/InvalidFilter.cpp ('k') | compiled/RegExpFilter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: compiled/RegExpFilter.h
===================================================================
new file mode 100644
--- /dev/null
+++ b/compiled/RegExpFilter.h
@@ -0,0 +1,34 @@
+#ifndef ADBLOCK_PLUS_REG_EXP_FILTER_H
+#define ADBLOCK_PLUS_REG_EXP_FILTER_H
+
+#include <string>
+
+#include "Filter.h"
+#include "ActiveFilter.h"
+
+class RegExpFilter : public ActiveFilter
+{
+private:
+ enum TrippleState {YES, NO, ANY};
+
+ int regexpId;
+ std::u16string regexpSource;
+ int contentType;
+ bool matchCase;
+ TrippleState thirdParty;
+ TrippleState collapse;
+ void ProcessOption(const std::u16string& options, int optionStart,
+ int optionEnd, int valueStart, int valueEnd);
+public:
+ explicit RegExpFilter(const std::u16string& text, const std::u16string& pattern,
+ const std::u16string& options);
+ ~RegExpFilter();
+ static Filter* Create(const std::u16string& text);
+ static void InitJSTypes();
+ Type GetType() const;
+ bool Matches(const std::u16string& location, int typeMask,
+ const std::u16string& docDomain, bool thirdParty,
+ const std::u16string& sitekey);
+};
+
+#endif
« no previous file with comments | « compiled/InvalidFilter.cpp ('k') | compiled/RegExpFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld