diff options
author | Pieter Wuille <pieter.wuille@gmail.com> | 2012-04-21 01:37:34 +0200 |
---|---|---|
committer | Pieter Wuille <pieter.wuille@gmail.com> | 2012-04-21 01:37:34 +0200 |
commit | e46704dd904192d8731eae1226805252e5252a0e (patch) | |
tree | f666357cc03a91c4be20331983c335d1ad603ad2 /src/bitcoinrpc.h | |
parent | 9862229d4d852279b937c18cdbe076418585844e (diff) |
Expose CRPCTable via bitcoinrpc.h for testing
Diffstat (limited to 'src/bitcoinrpc.h')
-rw-r--r-- | src/bitcoinrpc.h | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/bitcoinrpc.h b/src/bitcoinrpc.h index a9cf3296f7..6b7293ed19 100644 --- a/src/bitcoinrpc.h +++ b/src/bitcoinrpc.h @@ -3,5 +3,39 @@ // Distributed under the MIT/X11 software license, see the accompanying // file license.txt or http://www.opensource.org/licenses/mit-license.php. +#ifndef _BITCOINRPC_H_ +#define _BITCOINRPC_H_ 1 + +#include <string> +#include <map> + +#include "json/json_spirit_reader_template.h" +#include "json/json_spirit_writer_template.h" +#include "json/json_spirit_utils.h" + void ThreadRPCServer(void* parg); int CommandLineRPC(int argc, char *argv[]); + +typedef json_spirit::Value(*rpcfn_type)(const json_spirit::Array& params, bool fHelp); + +class CRPCCommand +{ +public: + std::string name; + rpcfn_type actor; + bool okSafeMode; +}; + +class CRPCTable +{ +private: + std::map<std::string, const CRPCCommand*> mapCommands; +public: + CRPCTable(); + const CRPCCommand* operator[](std::string name) const; + std::string help(std::string name) const; +}; + +extern const CRPCTable tableRPC; + +#endif |