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 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
377 | 377 |
378 try | 378 try |
379 { | 379 { |
380 CallAdblockPlusEngineProcedure(request); | 380 CallAdblockPlusEngineProcedure(request); |
381 } | 381 } |
382 catch (const std::exception& e) | 382 catch (const std::exception& e) |
383 { | 383 { |
384 DEBUG_GENERAL(e.what()); | 384 DEBUG_GENERAL(e.what()); |
385 } | 385 } |
386 } | 386 } |
| 387 |
| 388 void CAdblockPlusClient::SetPref(const std::wstring& name, const std::wstring& v
alue) |
| 389 { |
| 390 Communication::OutputBuffer request; |
| 391 request << Communication::PROC_SET_PREF << ToUtf8String(name) << ToUtf8String(
value); |
| 392 |
| 393 try |
| 394 { |
| 395 CallAdblockPlusEngineProcedure(request); |
| 396 } |
| 397 catch (const std::exception& e) |
| 398 { |
| 399 DEBUG_GENERAL(e.what()); |
| 400 } |
| 401 } |
| 402 |
| 403 std::wstring CAdblockPlusClient::GetPref(const std::wstring& name) |
| 404 { |
| 405 Communication::OutputBuffer request; |
| 406 request << Communication::PROC_GET_PREF << ToUtf8String(name); |
| 407 |
| 408 try |
| 409 { |
| 410 Communication::InputBuffer response = CallAdblockPlusEngineProcedure(request
); |
| 411 std::vector<std::wstring> retValue = ReadStrings(response); |
| 412 return retValue.size() > 0 ? retValue.at(0) : L""; |
| 413 } |
| 414 catch (const std::exception& e) |
| 415 { |
| 416 DEBUG_GENERAL(e.what()); |
| 417 return L""; |
| 418 } |
| 419 } |
OLD | NEW |