| LEFT | RIGHT |
| (no file at all) | |
| 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 "SubscriptionsCommand.h" | 8 #include "SubscriptionsCommand.h" |
| 9 #include "MatchesCommand.h" | 9 #include "MatchesCommand.h" |
| 10 | 10 |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 } | 53 } |
| 54 } | 54 } |
| 55 | 55 |
| 56 int main() | 56 int main() |
| 57 { | 57 { |
| 58 try | 58 try |
| 59 { | 59 { |
| 60 LibFileReader fileReader; | 60 LibFileReader fileReader; |
| 61 CerrErrorCallback errorCallback; | 61 CerrErrorCallback errorCallback; |
| 62 AdblockPlus::JsEngine jsEngine(&fileReader, 0); | 62 AdblockPlus::JsEngine jsEngine(&fileReader, 0); |
| 63 jsEngine.Load("adblockplus_compat.js"); | |
| 64 jsEngine.Load("adblockplus.js"); | |
| 65 | 63 |
| 66 CommandMap commands; | 64 CommandMap commands; |
| 67 Add(commands, new GcCommand(jsEngine)); | 65 Add(commands, new GcCommand(jsEngine)); |
| 68 Add(commands, new HelpCommand(commands)); | 66 Add(commands, new HelpCommand(commands)); |
| 69 Add(commands, new SubscriptionsCommand(jsEngine)); | 67 Add(commands, new SubscriptionsCommand(jsEngine)); |
| 70 Add(commands, new MatchesCommand()); | 68 Add(commands, new MatchesCommand()); |
| 71 | 69 |
| 72 std::string commandLine; | 70 std::string commandLine; |
| 73 while (ReadCommandLine(commandLine)) | 71 while (ReadCommandLine(commandLine)) |
| 74 { | 72 { |
| (...skipping 13 matching lines...) Expand all Loading... |
| 88 std::cout << error.what() << std::endl; | 86 std::cout << error.what() << std::endl; |
| 89 } | 87 } |
| 90 } | 88 } |
| 91 } | 89 } |
| 92 catch (const std::exception& e) | 90 catch (const std::exception& e) |
| 93 { | 91 { |
| 94 std::cerr << "Exception: " << e.what() << std::endl; | 92 std::cerr << "Exception: " << e.what() << std::endl; |
| 95 } | 93 } |
| 96 return 0; | 94 return 0; |
| 97 } | 95 } |
| LEFT | RIGHT |