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: Reworked JS binding generation Created Feb. 1, 2016, 9:14 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
Index: compiled/RegExpFilter.h
===================================================================
new file mode 100644
--- /dev/null
+++ b/compiled/RegExpFilter.h
@@ -0,0 +1,32 @@
+#ifndef ADBLOCK_PLUS_REG_EXP_FILTER_H
+#define ADBLOCK_PLUS_REG_EXP_FILTER_H
+
+#include "Filter.h"
+#include "ActiveFilter.h"
+
+class RegExpFilter : public ActiveFilter
+{
+private:
+ enum TrippleState {YES, NO, ANY};
+
+ mutable int mRegexpId;
+ String mRegexpSource;
+ int mContentType;
+ bool mMatchCase;
+ TrippleState mThirdParty;
+ TrippleState mCollapse;
+ void ProcessOption(String& options, int optionStart,
+ int optionEnd, int valueStart, int valueEnd);
+public:
+ explicit RegExpFilter(const String& text,
+ String::size_type patternStart, String::size_type patternEnd);
+ ~RegExpFilter();
+ static Filter* Create(const String& text);
+ EMSCRIPTEN_KEEPALIVE static void InitJSTypes();
+ static String RegExpFromSource(const String& source);
+ Type GetType() const;
+ EMSCRIPTEN_KEEPALIVE bool Matches(const String& location, int typeMask, String& docDomain,
+ bool thirdParty, const String& sitekey) const;
+};
+
+#endif

Powered by Google App Engine
This is Rietveld