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

Side by Side Diff: include/AdblockPlus/FilterEngine.h

Issue 10100009: FilterEngine API improvements (Closed)
Patch Set: Changed filter type enum Created April 9, 2013, 5:55 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | shell/src/FiltersCommand.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #ifndef ADBLOCKPLUS_FILTER_ENGINE_H 1 #ifndef ADBLOCKPLUS_FILTER_ENGINE_H
2 #define ADBLOCKPLUS_FILTER_ENGINE_H 2 #define ADBLOCKPLUS_FILTER_ENGINE_H
3 3
4 #include <vector> 4 #include <vector>
5 #include <map> 5 #include <map>
6 #include <string> 6 #include <string>
7 #include <tr1/memory> 7 #include <tr1/memory>
8 8
9 namespace AdblockPlus 9 namespace AdblockPlus
10 { 10 {
(...skipping 25 matching lines...) Expand all
36 36
37 FilterEngine& filterEngine; 37 FilterEngine& filterEngine;
38 std::map<std::string, std::string> stringProperties; 38 std::map<std::string, std::string> stringProperties;
39 std::map<std::string, int> intProperties; 39 std::map<std::string, int> intProperties;
40 std::map<std::string, bool> boolProperties; 40 std::map<std::string, bool> boolProperties;
41 #else 41 #else
42 JsObject(); 42 JsObject();
43 #endif 43 #endif
44 }; 44 };
45 45
46 enum FilterType {BLOCKING_RULE, EXCEPTION_RULE,
47 ELEMHIDE_RULE, ELEMHIDE_EXCEPTION_RULE,
48 COMMENT_RULE, INVALID_RULE};
49
50 class Filter : public JsObject, 46 class Filter : public JsObject,
51 public std::tr1::enable_shared_from_this<Filter> 47 public std::tr1::enable_shared_from_this<Filter>
52 { 48 {
53 friend class FilterEngine; 49 friend class FilterEngine;
54 50
55 public: 51 public:
52 enum Type {TYPE_BLOCKING, TYPE_EXCEPTION,
53 TYPE_ELEMHIDE, TYPE_ELEMHIDE_EXCEPTION,
54 TYPE_COMMENT, TYPE_INVALID};
55
56 bool IsListed() const; 56 bool IsListed() const;
57 void AddToList(); 57 void AddToList();
58 void RemoveFromList(); 58 void RemoveFromList();
59 59
60 private: 60 private:
61 #if FILTER_ENGINE_STUBS 61 #if FILTER_ENGINE_STUBS
62 Filter(FilterEngine& filterEngine, const std::string& text); 62 Filter(FilterEngine& filterEngine, const std::string& text);
63 #else 63 #else
64 Filter(); 64 Filter();
65 #endif 65 #endif
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 #if FILTER_ENGINE_STUBS 109 #if FILTER_ENGINE_STUBS
110 std::map<std::string, FilterPtr> knownFilters; 110 std::map<std::string, FilterPtr> knownFilters;
111 std::vector<FilterPtr> listedFilters; 111 std::vector<FilterPtr> listedFilters;
112 std::map<std::string, SubscriptionPtr> knownSubscriptions; 112 std::map<std::string, SubscriptionPtr> knownSubscriptions;
113 std::vector<SubscriptionPtr> listedSubscriptions; 113 std::vector<SubscriptionPtr> listedSubscriptions;
114 #endif 114 #endif
115 }; 115 };
116 } 116 }
117 117
118 #endif 118 #endif
OLDNEW
« no previous file with comments | « no previous file | shell/src/FiltersCommand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld