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

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

Issue 29384812: Issue 4127 - [emscripten] Convert subscription classes to C++ - Part 1 (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore
Left Patch Set: Fixed method names according to convention Created March 16, 2017, 6:26 p.m.
Right Patch Set: Addressed comments Created April 13, 2017, 1:02 p.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
« no previous file with change/comment | « compiled/bindings.ipp ('k') | compiled/subscription/DownloadableSubscription.h » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-2017 eyeo GmbH
4 *
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
7 * published by the Free Software Foundation.
8 *
9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
16 */
17
1 #pragma once 18 #pragma once
2 19
3 #include <vector> 20 #include <vector>
4 21
5 #include "../String.h" 22 #include "../String.h"
6 #include "../intrusive_ptr.h" 23 #include "../intrusive_ptr.h"
7 #include "../debug.h" 24 #include "../debug.h"
8 25
9 class Filter : public ref_counted 26 class Filter : public ref_counted
10 { 27 {
11 protected: 28 protected:
12 OwnedString mText; 29 OwnedString mText;
13 30
14 public: 31 public:
15 enum Type 32 enum Type
16 { 33 {
17 UNKNOWN = 0, 34 UNKNOWN = 0,
18 INVALID = 1, 35 INVALID = 1,
19 COMMENT = 2, 36 COMMENT = 2,
20 BLOCKING = 3, 37 BLOCKING = 3,
21 WHITELIST = 4, 38 WHITELIST = 4,
22 ELEMHIDE = 5, 39 ELEMHIDE = 5,
23 ELEMHIDEEXCEPTION = 6, 40 ELEMHIDEEXCEPTION = 6,
24 ELEMHIDEEMULATION = 7, 41 ELEMHIDEEMULATION = 7,
25 MAXTYPE = 7 42 VALUE_COUNT = 8
26 }; 43 };
27 44
28 explicit Filter(Type type, const String& text); 45 explicit Filter(Type type, const String& text);
29 ~Filter(); 46 ~Filter();
30 47
31 Type mType; 48 Type mType;
32 49
33 /* TODO 50 /* TODO
34 std::vector<Subscription> mSubscriptions; 51 std::vector<Subscription> mSubscriptions;
35 */ 52 */
36 53
37 EMSCRIPTEN_KEEPALIVE const String& GetText() const 54 EMSCRIPTEN_KEEPALIVE const String& GetText() const
38 { 55 {
39 return mText; 56 return mText;
40 } 57 }
41 58
42 EMSCRIPTEN_KEEPALIVE OwnedString Serialize() const; 59 EMSCRIPTEN_KEEPALIVE OwnedString Serialize() const;
43 60
44 static EMSCRIPTEN_KEEPALIVE Filter* FromText(DependentString& text); 61 static EMSCRIPTEN_KEEPALIVE Filter* FromText(DependentString& text);
45 }; 62 };
46 63
47 typedef intrusive_ptr<Filter> FilterPtr; 64 typedef intrusive_ptr<Filter> FilterPtr;
LEFTRIGHT

Powered by Google App Engine
This is Rietveld