MCPcopy Create free account
hub / github.com/amule-project/amule / FindCommandId

Method FindCommandId

src/ExternalConnector.cpp:85–107  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

83
84
85int CCommandTree::FindCommandId(const wxString& command, wxString& args, wxString& cmdstr) const
86{
87 wxString cmd = command.BeforeFirst(' ').Lower();
88 for (CmdPosConst_t it = m_subcommands.begin(); it != m_subcommands.end(); ++it) {
89 if ((*it)->m_command.Lower() == cmd) {
90 args = command.AfterFirst(' ').Trim(false);
91 return (*it)->FindCommandId(args, args, cmdstr);
92 }
93 }
94 cmdstr = GetFullCommand().Lower();
95 if (m_params == CMD_PARAM_ALWAYS && args.IsEmpty()) {
96 return CMD_ERR_MUST_HAVE_PARAM;
97 } else if (m_params == CMD_PARAM_NEVER && !args.IsEmpty()) {
98 return CMD_ERR_NO_PARAM;
99 } else {
100 if ((m_cmd_id >= 0) && (m_cmd_id & CMD_DEPRECATED)) {
101 m_app->Show('\n' + m_verbose + '\n');
102 return m_cmd_id & ~CMD_DEPRECATED;
103 } else {
104 return m_cmd_id;
105 }
106 }
107}
108
109
110wxString CCommandTree::GetFullCommand() const

Callers 1

GetIDFromStringMethod · 0.80

Calls 4

ShowMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
IsEmptyMethod · 0.45

Tested by

no test coverage detected