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 |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 { | 56 { |
57 try | 57 try |
58 { | 58 { |
59 AdblockPlus::AppInfo appInfo; | 59 AdblockPlus::AppInfo appInfo; |
60 appInfo.version = "1.0"; | 60 appInfo.version = "1.0"; |
61 appInfo.name = "abpshell"; | 61 appInfo.name = "abpshell"; |
62 appInfo.application = "standalone"; | 62 appInfo.application = "standalone"; |
63 appInfo.applicationVersion = "1.0"; | 63 appInfo.applicationVersion = "1.0"; |
64 appInfo.locale = "en-US"; | 64 appInfo.locale = "en-US"; |
65 | 65 |
66 AdblockPlus::Platform platform; | 66 auto platform = AdblockPlus::DefaultPlatformBuilder().CreatePlatform(); |
67 platform.SetUpJsEngine(appInfo); | 67 platform->SetUpJsEngine(appInfo); |
68 AdblockPlus::JsEngine& jsEngine = platform.GetJsEngine(); | 68 AdblockPlus::JsEngine& jsEngine = platform->GetJsEngine(); |
69 auto& filterEngine = platform.GetFilterEngine(); | 69 auto& filterEngine = platform->GetFilterEngine(); |
70 | 70 |
71 CommandMap commands; | 71 CommandMap commands; |
72 Add(commands, new GcCommand(jsEngine)); | 72 Add(commands, new GcCommand(jsEngine)); |
73 Add(commands, new HelpCommand(commands)); | 73 Add(commands, new HelpCommand(commands)); |
74 Add(commands, new FiltersCommand(filterEngine)); | 74 Add(commands, new FiltersCommand(filterEngine)); |
75 Add(commands, new SubscriptionsCommand(filterEngine)); | 75 Add(commands, new SubscriptionsCommand(filterEngine)); |
76 Add(commands, new MatchesCommand(filterEngine)); | 76 Add(commands, new MatchesCommand(filterEngine)); |
77 Add(commands, new PrefsCommand(filterEngine)); | 77 Add(commands, new PrefsCommand(filterEngine)); |
78 | 78 |
79 std::string commandLine; | 79 std::string commandLine; |
(...skipping 15 matching lines...) Expand all Loading... |
95 std::cout << error.what() << std::endl; | 95 std::cout << error.what() << std::endl; |
96 } | 96 } |
97 } | 97 } |
98 } | 98 } |
99 catch (const std::exception& e) | 99 catch (const std::exception& e) |
100 { | 100 { |
101 std::cerr << "Exception: " << e.what() << std::endl; | 101 std::cerr << "Exception: " << e.what() << std::endl; |
102 } | 102 } |
103 return 0; | 103 return 0; |
104 } | 104 } |
OLD | NEW |