OLD | NEW |
1 #include "PluginStdAfx.h" | 1 #include "PluginStdAfx.h" |
2 | 2 |
3 #include "PluginSettings.h" | 3 #include "PluginSettings.h" |
4 #include "PluginSystem.h" | 4 #include "PluginSystem.h" |
5 #include "PluginFilter.h" | 5 #include "PluginFilter.h" |
6 #include "PluginClientFactory.h" | 6 #include "PluginClientFactory.h" |
7 #include "PluginMutex.h" | 7 #include "PluginMutex.h" |
8 #include "PluginClass.h" | 8 #include "PluginClass.h" |
9 | 9 |
10 #include "AdblockPlusClient.h" | 10 #include "AdblockPlusClient.h" |
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
390 else | 390 else |
391 return defaultValue; | 391 return defaultValue; |
392 } | 392 } |
393 int64_t CAdblockPlusClient::GetPref(const std::wstring& name, int64_t defaultVal
ue) | 393 int64_t CAdblockPlusClient::GetPref(const std::wstring& name, int64_t defaultVal
ue) |
394 { | 394 { |
395 Communication::OutputBuffer request; | 395 Communication::OutputBuffer request; |
396 request << Communication::PROC_GET_PREF << ToUtf8String(name); | 396 request << Communication::PROC_GET_PREF << ToUtf8String(name); |
397 | 397 |
398 Communication::InputBuffer response; | 398 Communication::InputBuffer response; |
399 if (!CallEngine(request, response)) return defaultValue; | 399 if (!CallEngine(request, response)) return defaultValue; |
400 bool success; | 400 bool success; |
401 response >> success; | 401 response >> success; |
402 if (success) | 402 if (success) |
403 { | 403 { |
404 int64_t value; | 404 int64_t value; |
405 response >> value; | 405 response >> value; |
406 return value; | 406 return value; |
407 } | 407 } |
408 else | 408 else |
409 return defaultValue; | 409 return defaultValue; |
410 } | 410 } |
| 411 |
| 412 std::wstring CAdblockPlusClient::GetRequire(const std::wstring& name) |
| 413 { |
| 414 Communication::OutputBuffer request; |
| 415 request << Communication::PROC_GET_REQUIRE << ToUtf8String(name); |
| 416 |
| 417 Communication::InputBuffer response; |
| 418 if (!CallEngine(request, response)) return L""; |
| 419 bool success; |
| 420 response >> success; |
| 421 std::string responseContent; |
| 422 if (success) |
| 423 { |
| 424 response >> responseContent; |
| 425 } |
| 426 return ToUtf16String(responseContent); |
| 427 } |
OLD | NEW |