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

Delta Between Two Patch Sets: compiled/filter/RegExpFilter.h

Issue 29613616: Issue 6064 - Put C++ code into a configurable namespace (Closed) Base URL: https://github.com/adblockplus/adblockpluscore.git
Left Patch Set: address comments Created Nov. 22, 2017, 9:36 a.m.
Right Patch Set: rebase Created Feb. 6, 2018, 9:54 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
LEFTRIGHT
1 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-present eyeo GmbH 3 * Copyright (C) 2006-present eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 23 matching lines...) Expand all
34 mutable int mRegexpId; 34 mutable int mRegexpId;
35 mutable String::size_type mPatternEnd; 35 mutable String::size_type mPatternEnd;
36 }; 36 };
37 mutable String::size_type mDomainsStart; 37 mutable String::size_type mDomainsStart;
38 mutable String::size_type mDomainsEnd; 38 mutable String::size_type mDomainsEnd;
39 mutable String::size_type mSitekeysStart; 39 mutable String::size_type mSitekeysStart;
40 mutable String::size_type mSitekeysEnd; 40 mutable String::size_type mSitekeysEnd;
41 int mContentType; 41 int mContentType;
42 bool mMatchCase; 42 bool mMatchCase;
43 TrippleState mThirdParty; 43 TrippleState mThirdParty;
44 TrippleState mCollapse; 44 bool mCollapse;
45 45
46 bool RegExpParsingDone() const 46 bool RegExpParsingDone() const
47 { 47 {
48 return mPatternStart == String::npos; 48 return mPatternStart == String::npos;
49 } 49 }
50 50
51 void SetRegExp(int regexpId) const 51 void SetRegExp(int regexpId) const
52 { 52 {
53 mRegexpId = regexpId; 53 mRegexpId = regexpId;
54 mPatternStart = String::npos; 54 mPatternStart = String::npos;
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 { 99 {
100 private: 100 private:
101 void ParseSitekeys(const String& sitekeys) const; 101 void ParseSitekeys(const String& sitekeys) const;
102 102
103 protected: 103 protected:
104 RegExpFilterData mData; 104 RegExpFilterData mData;
105 105
106 DomainMap* GetDomains() const override; 106 DomainMap* GetDomains() const override;
107 SitekeySet* GetSitekeys() const override; 107 SitekeySet* GetSitekeys() const override;
108 public: 108 public:
109 static constexpr Type classType = Type::REGEXP;
109 explicit RegExpFilter(Type type, const String& text, const RegExpFilterData& d ata); 110 explicit RegExpFilter(Type type, const String& text, const RegExpFilterData& d ata);
110 ~RegExpFilter(); 111 ~RegExpFilter();
111 static Type Parse(DependentString& text, DependentString& error, 112 static Type Parse(DependentString& text, DependentString& error,
112 RegExpFilterData& data); 113 RegExpFilterData& data);
113 static void GenerateCustomBindings(); 114 static void GenerateCustomBindings();
114 bool BINDINGS_EXPORTED Matches(const String& location, int typeMask, 115 bool BINDINGS_EXPORTED Matches(const String& location, int typeMask,
115 DependentString& docDomain, bool thirdParty, const String& sitekey) const; 116 DependentString& docDomain, bool thirdParty, const String& sitekey) const;
116 }; 117 };
117 118
119 typedef intrusive_ptr<RegExpFilter> RegExpFilterPtr;
120
118 ABP_NS_END 121 ABP_NS_END
LEFTRIGHT

Powered by Google App Engine
This is Rietveld