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-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 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 case AdblockPlus::Filter::TYPE_COMMENT: | 47 case AdblockPlus::Filter::TYPE_COMMENT: |
48 type = "comment"; | 48 type = "comment"; |
49 break; | 49 break; |
50 case AdblockPlus::Filter::TYPE_INVALID: | 50 case AdblockPlus::Filter::TYPE_INVALID: |
51 type = "invalid"; | 51 type = "invalid"; |
52 break; | 52 break; |
53 default: | 53 default: |
54 type = "(unknown type)"; | 54 type = "(unknown type)"; |
55 break; | 55 break; |
56 } | 56 } |
57 std::cout << (*it)->GetProperty("text")->AsString() << " - " << | 57 std::cout << (*it)->GetProperty("text").AsString() << " - " << |
58 type << std::endl; | 58 type << std::endl; |
59 } | 59 } |
60 } | 60 } |
61 } | 61 } |
62 | 62 |
63 FiltersCommand::FiltersCommand(AdblockPlus::FilterEngine& filterEngine) | 63 FiltersCommand::FiltersCommand(AdblockPlus::FilterEngine& filterEngine) |
64 : Command("filters"), filterEngine(filterEngine) | 64 : Command("filters"), filterEngine(filterEngine) |
65 { | 65 { |
66 } | 66 } |
67 | 67 |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 void FiltersCommand::RemoveFilter(const std::string& text) | 122 void FiltersCommand::RemoveFilter(const std::string& text) |
123 { | 123 { |
124 AdblockPlus::FilterPtr filter = filterEngine.GetFilter(text); | 124 AdblockPlus::FilterPtr filter = filterEngine.GetFilter(text); |
125 if (!filter->IsListed()) | 125 if (!filter->IsListed()) |
126 { | 126 { |
127 std::cout << "No such filter '" << text << "'" << std::endl; | 127 std::cout << "No such filter '" << text << "'" << std::endl; |
128 return; | 128 return; |
129 } | 129 } |
130 filter->RemoveFromList(); | 130 filter->RemoveFromList(); |
131 } | 131 } |
OLD | NEW |