diff options
author | Marek Kotewicz <marek.kotewicz@gmail.com> | 2014-10-28 18:39:55 +0800 |
---|---|---|
committer | Marek Kotewicz <marek.kotewicz@gmail.com> | 2014-10-28 18:39:55 +0800 |
commit | 79bb03513bb191cb570c3bde4283626e2e6e5b58 (patch) | |
tree | 7dce7ad3aa420ea37114a5a68667f352583fe87d /webthreestubclient.h | |
parent | c30ce74fe098d0864d4d178259f0ce1946c5d8bf (diff) | |
download | dexon-solidity-79bb03513bb191cb570c3bde4283626e2e6e5b58.tar dexon-solidity-79bb03513bb191cb570c3bde4283626e2e6e5b58.tar.gz dexon-solidity-79bb03513bb191cb570c3bde4283626e2e6e5b58.tar.bz2 dexon-solidity-79bb03513bb191cb570c3bde4283626e2e6e5b58.tar.lz dexon-solidity-79bb03513bb191cb570c3bde4283626e2e6e5b58.tar.xz dexon-solidity-79bb03513bb191cb570c3bde4283626e2e6e5b58.tar.zst dexon-solidity-79bb03513bb191cb570c3bde4283626e2e6e5b58.zip |
ldb access from api
Diffstat (limited to 'webthreestubclient.h')
-rw-r--r-- | webthreestubclient.h | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/webthreestubclient.h b/webthreestubclient.h index 911d757e..c25ea0d9 100644 --- a/webthreestubclient.h +++ b/webthreestubclient.h @@ -171,6 +171,20 @@ class WebThreeStubClient } + std::string get(const std::string& param1, const std::string& param2) throw (jsonrpc::JsonRpcException) + { + Json::Value p; + p.append(param1); +p.append(param2); + + Json::Value result = this->client->CallMethod("get",p); + if (result.isString()) + return result.asString(); + else + throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); + + } + Json::Value getMessages(const int& param1) throw (jsonrpc::JsonRpcException) { Json::Value p; @@ -184,6 +198,20 @@ class WebThreeStubClient } + std::string getString(const std::string& param1, const std::string& param2) throw (jsonrpc::JsonRpcException) + { + Json::Value p; + p.append(param1); +p.append(param2); + + Json::Value result = this->client->CallMethod("getString",p); + if (result.isString()) + return result.asString(); + else + throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); + + } + bool listening() throw (jsonrpc::JsonRpcException) { Json::Value p; @@ -258,6 +286,36 @@ class WebThreeStubClient } + bool put(const std::string& param1, const std::string& param2, const std::string& param3) throw (jsonrpc::JsonRpcException) + { + Json::Value p; + p.append(param1); +p.append(param2); +p.append(param3); + + Json::Value result = this->client->CallMethod("put",p); + if (result.isBool()) + return result.asBool(); + else + throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); + + } + + bool putString(const std::string& param1, const std::string& param2, const std::string& param3) throw (jsonrpc::JsonRpcException) + { + Json::Value p; + p.append(param1); +p.append(param2); +p.append(param3); + + Json::Value result = this->client->CallMethod("putString",p); + if (result.isBool()) + return result.asBool(); + else + throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); + + } + bool setCoinbase(const std::string& param1) throw (jsonrpc::JsonRpcException) { Json::Value p; |