| Index: src/plugin/AdblockPlusClient.cpp |
| =================================================================== |
| --- a/src/plugin/AdblockPlusClient.cpp |
| +++ b/src/plugin/AdblockPlusClient.cpp |
| @@ -384,3 +384,36 @@ |
| DEBUG_GENERAL(e.what()); |
| } |
| } |
| + |
| +void CAdblockPlusClient::SetPref(const std::wstring& name, const std::wstring& value) |
| +{ |
| + Communication::OutputBuffer request; |
| + request << Communication::PROC_SET_PREF << ToUtf8String(name) << ToUtf8String(value); |
| + |
| + try |
| + { |
| + CallAdblockPlusEngineProcedure(request); |
| + } |
| + catch (const std::exception& e) |
| + { |
| + DEBUG_GENERAL(e.what()); |
| + } |
| +} |
| + |
| +std::wstring CAdblockPlusClient::GetPref(const std::wstring& name) |
| +{ |
| + Communication::OutputBuffer request; |
| + request << Communication::PROC_GET_PREF << ToUtf8String(name); |
| + |
| + try |
| + { |
| + Communication::InputBuffer response = CallAdblockPlusEngineProcedure(request); |
| + std::vector<std::wstring> retValue = ReadStrings(response); |
| + return retValue.size() > 0 ? retValue.at(0) : L""; |
|
Wladimir Palant
2013/07/11 12:53:10
This really shouldn't try to read a list of string
|
| + } |
| + catch (const std::exception& e) |
| + { |
| + DEBUG_GENERAL(e.what()); |
| + return L""; |
| + } |
| +} |