diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2018-05-26 19:32:18 +0100 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2018-05-26 20:18:30 +0100 |
commit | 6a58c88e2d2e1e5b61e2cce3ac9f7ab843863f35 (patch) | |
tree | f54b2d323eae4c8f93078aba0644d97302451e00 /contrib/epee | |
parent | Merge pull request #3800 (diff) | |
download | monero-6a58c88e2d2e1e5b61e2cce3ac9f7ab843863f35.tar.xz |
console_handler: fix start_default_console use of prompt parameter
It had not been updated to the function type change
Diffstat (limited to 'contrib/epee')
-rw-r--r-- | contrib/epee/include/console_handler.h | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/contrib/epee/include/console_handler.h b/contrib/epee/include/console_handler.h index 4ea3fa54b..0e22a971c 100644 --- a/contrib/epee/include/console_handler.h +++ b/contrib/epee/include/console_handler.h @@ -401,13 +401,19 @@ eof: template<class t_server, class t_handler> - bool start_default_console(t_server* ptsrv, t_handler handlr, const std::string& prompt, const std::string& usage = "") + bool start_default_console(t_server* ptsrv, t_handler handlr, std::function<std::string(void)> prompt, const std::string& usage = "") { std::shared_ptr<async_console_handler> console_handler = std::make_shared<async_console_handler>(); boost::thread([=](){console_handler->run<t_server, t_handler>(ptsrv, handlr, prompt, usage);}).detach(); return true; } + template<class t_server, class t_handler> + bool start_default_console(t_server* ptsrv, t_handler handlr, const std::string& prompt, const std::string& usage = "") + { + return start_default_console(ptsrv, handlr, [prompt](){ return prompt; }, usage); + } + template<class t_server> bool start_default_console(t_server* ptsrv, const std::string& prompt, const std::string& usage = "") { @@ -421,19 +427,31 @@ eof: } template<class t_server, class t_handler> - bool run_default_console_handler_no_srv_param(t_server* ptsrv, t_handler handlr, const std::string& prompt, const std::string& usage = "") + bool run_default_console_handler_no_srv_param(t_server* ptsrv, t_handler handlr, std::function<std::string(void)> prompt, const std::string& usage = "") { async_console_handler console_handler; return console_handler.run(ptsrv, boost::bind<bool>(no_srv_param_adapter<t_server, t_handler>, _1, _2, handlr), prompt, usage); } template<class t_server, class t_handler> - bool start_default_console_handler_no_srv_param(t_server* ptsrv, t_handler handlr, const std::string& prompt, const std::string& usage = "") + bool run_default_console_handler_no_srv_param(t_server* ptsrv, t_handler handlr, const std::string& prompt, const std::string& usage = "") + { + return run_default_console_handler_no_srv_param(ptsrv, handlr, [prompt](){return prompt;},usage); + } + + template<class t_server, class t_handler> + bool start_default_console_handler_no_srv_param(t_server* ptsrv, t_handler handlr, std::function<std::string(void)> prompt, const std::string& usage = "") { boost::thread( boost::bind(run_default_console_handler_no_srv_param<t_server, t_handler>, ptsrv, handlr, prompt, usage) ); return true; } + template<class t_server, class t_handler> + bool start_default_console_handler_no_srv_param(t_server* ptsrv, t_handler handlr, const std::string& prompt, const std::string& usage = "") + { + return start_default_console_handler_no_srv_param(ptsrv, handlr, [prompt](){return prompt;}, usage); + } + /*template<class a> bool f(int i, a l) { |