#include <console_handler.h>
|
| typedef boost::function< bool(const std::vector< std::string > &)> | callback |
| |
| typedef std::map< std::string, std::pair< callback, std::pair< std::string, std::string > > > | lookup |
| |
Definition at line 482 of file console_handler.h.
◆ callback
◆ lookup
◆ get_documentation()
| std::pair<std::string, std::string> epee::command_handler::get_documentation |
( |
const std::vector< std::string > & |
cmd | ) |
|
|
inline |
Definition at line 498 of file console_handler.h.
501 return std::make_pair(
"",
"");
502 auto it = m_command_handlers.find(cmd.front());
503 if(it == m_command_handlers.end())
504 return std::make_pair(
"",
"");
505 return it->second.second;
◆ get_usage()
| std::string epee::command_handler::get_usage |
( |
| ) |
|
|
inline |
Definition at line 487 of file console_handler.h.
489 std::stringstream ss;
491 for(
auto& x:m_command_handlers)
493 ss << x.second.second.first <<
ENDL;
◆ process_command_str()
| bool epee::command_handler::process_command_str |
( |
const std::string & |
cmd | ) |
|
|
inline |
Definition at line 530 of file console_handler.h.
532 std::vector<std::string> cmd_v;
533 boost::split(cmd_v,cmd,boost::is_any_of(
" "), boost::token_compress_on);
bool process_command_vec(const std::vector< std::string > &cmd)
◆ process_command_vec()
| bool epee::command_handler::process_command_vec |
( |
const std::vector< std::string > & |
cmd | ) |
|
|
inline |
Definition at line 519 of file console_handler.h.
523 auto it = m_command_handlers.find(cmd.front());
524 if(it == m_command_handlers.end())
526 std::vector<std::string> cmd_local(cmd.begin()+1, cmd.end());
527 return it->second.first(cmd_local);
◆ set_handler()
| void epee::command_handler::set_handler |
( |
const std::string & |
cmd, |
|
|
const callback & |
hndlr, |
|
|
const std::string & |
usage = "", |
|
|
const std::string & |
description = "" |
|
) |
| |
|
inline |
Definition at line 508 of file console_handler.h.
510 lookup::mapped_type & vt = m_command_handlers[cmd];
512 vt.second.first = description.empty() ? cmd : usage;
513 vt.second.second = description.empty() ? usage : description;
static void add_completion(const std::string &command)
The documentation for this class was generated from the following file:
- /home/abuild/rpmbuild/BUILD/electroneum-5.0.0.4/contrib/epee/include/console_handler.h