| LEFT | RIGHT |
| (no file at all) | |
| 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 |
| 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 #include <cwctype> | 18 #include <cwctype> |
| 19 #include <mutex> | 19 #include <mutex> |
| 20 #include <regex> | 20 #include <regex> |
| 21 | 21 |
| 22 #include "String.h" | 22 #include "String.h" |
| 23 #include "Utils.h" | 23 #include "Utils.h" |
| 24 #include "debug.h" | 24 #include "debug.h" |
| 25 #include "library.h" | 25 #include "library.h" |
| 26 | 26 |
| 27 ABP_NS_USING |
| 27 | 28 |
| 28 char16_t CharToLower(char16_t charCode) | 29 char16_t CharToLower(char16_t charCode) |
| 29 { | 30 { |
| 30 return std::towlower(charCode); | 31 return std::towlower(charCode); |
| 31 } | 32 } |
| 32 | 33 |
| 33 | 34 |
| 34 void JSNotifyFilterChange(FilterNotifier::Topic topic, Filter& filter, | 35 void JSNotifyFilterChange(FilterNotifier::Topic topic, Filter& filter, |
| 35 Subscription* subscription, unsigned int position) | 36 Subscription* subscription, unsigned int position) |
| 36 { | 37 { |
| (...skipping 30 matching lines...) Expand all Loading... |
| 67 bool TestRegExp(int id, const String& str) | 68 bool TestRegExp(int id, const String& str) |
| 68 { | 69 { |
| 69 std::lock_guard<std::mutex> guard(regexPoolMutex); | 70 std::lock_guard<std::mutex> guard(regexPoolMutex); |
| 70 if ((id < regexPool.size()) && regexPool[id]) | 71 if ((id < regexPool.size()) && regexPool[id]) |
| 71 return std::regex_match(StdWStringFromString(str), *regexPool[id]); | 72 return std::regex_match(StdWStringFromString(str), *regexPool[id]); |
| 72 | 73 |
| 73 assert2(id < regexPool.size() && regexPool[id], "Invalid RegExp index."); | 74 assert2(id < regexPool.size() && regexPool[id], "Invalid RegExp index."); |
| 74 return false; | 75 return false; |
| 75 } | 76 } |
| 76 | 77 |
| LEFT | RIGHT |