From 460c51fdad07c89b64b60d680bad7ba89c9d5ee2 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Mon, 9 Apr 2012 21:07:25 +0200 Subject: Add UI RPC console / debug window --- src/bitcoinrpc.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/bitcoinrpc.h') diff --git a/src/bitcoinrpc.h b/src/bitcoinrpc.h index 6b7293ed19..dd18a504f3 100644 --- a/src/bitcoinrpc.h +++ b/src/bitcoinrpc.h @@ -16,6 +16,9 @@ void ThreadRPCServer(void* parg); int CommandLineRPC(int argc, char *argv[]); +/** Convert parameter values for RPC call from strings to command-specific JSON objects. */ +json_spirit::Array RPCConvertValues(const std::string &strMethod, const std::vector &strParams); + typedef json_spirit::Value(*rpcfn_type)(const json_spirit::Array& params, bool fHelp); class CRPCCommand @@ -26,6 +29,9 @@ public: bool okSafeMode; }; +/** + * Bitcoin RPC command dispatcher. + */ class CRPCTable { private: @@ -34,6 +40,15 @@ public: CRPCTable(); const CRPCCommand* operator[](std::string name) const; std::string help(std::string name) const; + + /** + * Execute a method. + * @param method Method to execute + * @param params Array of arguments (JSON objects) + * @returns Result of the call. + * @throws an exception (json_spirit::Value) when an error happens. + */ + json_spirit::Value execute(const std::string &method, const json_spirit::Array ¶ms) const; }; extern const CRPCTable tableRPC; -- cgit v1.2.3