| LEFT | RIGHT |
| 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-2017 eyeo GmbH | 3 * Copyright (C) 2006-2017 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 |
| 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 * GNU General Public License for more details. | 12 * GNU General Public License for more details. |
| 13 * | 13 * |
| 14 * You should have received a copy of the GNU General Public License | 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/>. | 15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. |
| 16 */ | 16 */ |
| 17 | 17 |
| 18 #pragma once | 18 #pragma once |
| 19 | 19 |
| 20 #include <type_traits> |
| 20 #include <vector> | 21 #include <vector> |
| 21 | 22 |
| 22 #include "../filter/Filter.h" | 23 #include "../filter/Filter.h" |
| 23 #include "../String.h" | 24 #include "../String.h" |
| 24 #include "../intrusive_ptr.h" | 25 #include "../intrusive_ptr.h" |
| 25 #include "../debug.h" | 26 #include "../debug.h" |
| 26 | 27 |
| 27 #define SUBSCRIPTION_PROPERTY(type, name, getter, setter) \ | 28 #define SUBSCRIPTION_PROPERTY(type, name, getter, setter) \ |
| 29 static_assert(std::is_arithmetic<type>::value, "SUBSCRIPTION_PROPERTY macro
can only be used with arithmetic types");\ |
| 28 private:\ | 30 private:\ |
| 29 type name;\ | 31 type name;\ |
| 30 public:\ | 32 public:\ |
| 31 type EMSCRIPTEN_KEEPALIVE getter() const\ | 33 type EMSCRIPTEN_KEEPALIVE getter() const\ |
| 32 {\ | 34 {\ |
| 33 return name;\ | 35 return name;\ |
| 34 }\ | 36 }\ |
| 35 void EMSCRIPTEN_KEEPALIVE setter(type value)\ | 37 void EMSCRIPTEN_KEEPALIVE setter(type value)\ |
| 36 {\ | 38 {\ |
| 37 if (name != value)\ | 39 if (name != value)\ |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 SUBSCRIPTION_STRING_PROPERTY(mTitle, GetTitle, SetTitle); | 107 SUBSCRIPTION_STRING_PROPERTY(mTitle, GetTitle, SetTitle); |
| 106 SUBSCRIPTION_PROPERTY(bool, mDisabled, GetDisabled, SetDisabled); | 108 SUBSCRIPTION_PROPERTY(bool, mDisabled, GetDisabled, SetDisabled); |
| 107 | 109 |
| 108 EMSCRIPTEN_KEEPALIVE OwnedString Serialize() const; | 110 EMSCRIPTEN_KEEPALIVE OwnedString Serialize() const; |
| 109 EMSCRIPTEN_KEEPALIVE OwnedString SerializeFilters() const; | 111 EMSCRIPTEN_KEEPALIVE OwnedString SerializeFilters() const; |
| 110 | 112 |
| 111 static EMSCRIPTEN_KEEPALIVE Subscription* FromID(const String& id); | 113 static EMSCRIPTEN_KEEPALIVE Subscription* FromID(const String& id); |
| 112 }; | 114 }; |
| 113 | 115 |
| 114 typedef intrusive_ptr<Subscription> SubscriptionPtr; | 116 typedef intrusive_ptr<Subscription> SubscriptionPtr; |
| LEFT | RIGHT |