OLD | NEW |
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 <cctype> | 18 #include <cctype> |
19 #include <climits> | 19 #include <climits> |
20 #include <cstdio> | 20 #include <cstdio> |
21 #include <string> | 21 #include <string> |
22 | 22 |
23 #include "RegExpFilter.h" | 23 #include "RegExpFilter.h" |
24 #include "../library.h" | 24 #include "../library.h" |
25 #include "../StringScanner.h" | 25 #include "../StringScanner.h" |
26 #include "../StringMap.h" | 26 #include "../StringMap.h" |
27 | 27 |
| 28 ABP_NS_USING |
| 29 |
28 namespace | 30 namespace |
29 { | 31 { |
30 enum | 32 enum |
31 { | 33 { |
32 TYPE_OTHER = 0x1, | 34 TYPE_OTHER = 0x1, |
33 TYPE_SCRIPT = 0x2, | 35 TYPE_SCRIPT = 0x2, |
34 TYPE_IMAGE = 0x4, | 36 TYPE_IMAGE = 0x4, |
35 TYPE_STYLESHEET = 0x8, | 37 TYPE_STYLESHEET = 0x8, |
36 TYPE_OBJECT = 0x10, | 38 TYPE_OBJECT = 0x10, |
37 TYPE_SUBDOCUMENT = 0x20, | 39 TYPE_SUBDOCUMENT = 0x20, |
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
388 return false; | 390 return false; |
389 } | 391 } |
390 | 392 |
391 if (!mData.RegExpParsingDone()) | 393 if (!mData.RegExpParsingDone()) |
392 { | 394 { |
393 const OwnedString pattern(mData.GetRegExpSource(mText)); | 395 const OwnedString pattern(mData.GetRegExpSource(mText)); |
394 mData.SetRegExp(GenerateRegExp(RegExpFromSource(pattern), mData.mMatchCase))
; | 396 mData.SetRegExp(GenerateRegExp(RegExpFromSource(pattern), mData.mMatchCase))
; |
395 } | 397 } |
396 return TestRegExp(mData.mRegexpId, location); | 398 return TestRegExp(mData.mRegexpId, location); |
397 } | 399 } |
OLD | NEW |