| OLD | NEW |
| 1 #include <AdblockPlus.h> | 1 #include <AdblockPlus.h> |
| 2 #include <fstream> | 2 #include <fstream> |
| 3 #include <iostream> | 3 #include <iostream> |
| 4 #include <sstream> | 4 #include <sstream> |
| 5 | 5 |
| 6 #include "GcCommand.h" | 6 #include "GcCommand.h" |
| 7 #include "HelpCommand.h" | 7 #include "HelpCommand.h" |
| 8 #include "FiltersCommand.h" | 8 #include "FiltersCommand.h" |
| 9 #include "SubscriptionsCommand.h" | 9 #include "SubscriptionsCommand.h" |
| 10 #include "MatchesCommand.h" | 10 #include "MatchesCommand.h" |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 } | 54 } |
| 55 } | 55 } |
| 56 | 56 |
| 57 int main() | 57 int main() |
| 58 { | 58 { |
| 59 try | 59 try |
| 60 { | 60 { |
| 61 LibFileReader fileReader; | 61 LibFileReader fileReader; |
| 62 AdblockPlus::DefaultWebRequest webRequest; | 62 AdblockPlus::DefaultWebRequest webRequest; |
| 63 CerrErrorCallback errorCallback; | 63 CerrErrorCallback errorCallback; |
| 64 AdblockPlus::JsEngine jsEngine(&fileReader, &webRequest, &errorCallback); | 64 AdblockPlus::AppInfo appInfo; |
| 65 appInfo.addonVersion = "1.0"; |
| 66 appInfo.addonName = "Adblock Plus Shell"; |
| 67 appInfo.application = "abpshell"; |
| 68 AdblockPlus::JsEngine jsEngine(appInfo, &fileReader, &webRequest, |
| 69 &errorCallback); |
| 65 AdblockPlus::FilterEngine filterEngine(jsEngine); | 70 AdblockPlus::FilterEngine filterEngine(jsEngine); |
| 66 | 71 |
| 67 CommandMap commands; | 72 CommandMap commands; |
| 68 Add(commands, new GcCommand(jsEngine)); | 73 Add(commands, new GcCommand(jsEngine)); |
| 69 Add(commands, new HelpCommand(commands)); | 74 Add(commands, new HelpCommand(commands)); |
| 70 Add(commands, new FiltersCommand(filterEngine)); | 75 Add(commands, new FiltersCommand(filterEngine)); |
| 71 Add(commands, new SubscriptionsCommand(filterEngine)); | 76 Add(commands, new SubscriptionsCommand(filterEngine)); |
| 72 Add(commands, new MatchesCommand(filterEngine)); | 77 Add(commands, new MatchesCommand(filterEngine)); |
| 73 | 78 |
| 74 std::string commandLine; | 79 std::string commandLine; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 90 std::cout << error.what() << std::endl; | 95 std::cout << error.what() << std::endl; |
| 91 } | 96 } |
| 92 } | 97 } |
| 93 } | 98 } |
| 94 catch (const std::exception& e) | 99 catch (const std::exception& e) |
| 95 { | 100 { |
| 96 std::cerr << "Exception: " << e.what() << std::endl; | 101 std::cerr << "Exception: " << e.what() << std::endl; |
| 97 } | 102 } |
| 98 return 0; | 103 return 0; |
| 99 } | 104 } |
| OLD | NEW |