CommandObjectMultiword.h [plain text]
#ifndef liblldb_CommandObjectMultiword_h_
#define liblldb_CommandObjectMultiword_h_
#include <map>
#include "lldb/Interpreter/CommandObject.h"
namespace lldb_private {
class CommandObjectMultiword : public CommandObject
{
friend class CommandInterpreter;
friend class CommandObjectSyntax;
public:
CommandObjectMultiword (CommandInterpreter &interpreter,
const char *name,
const char *help = NULL,
const char *syntax = NULL,
uint32_t flags = 0);
virtual
~CommandObjectMultiword ();
virtual bool
IsMultiwordObject () { return true; }
virtual bool
LoadSubCommand (const char *cmd_name,
const lldb::CommandObjectSP& command_obj);
virtual void
GenerateHelpText (CommandReturnObject &result);
virtual lldb::CommandObjectSP
GetSubcommandSP (const char *sub_cmd, StringList *matches = NULL);
virtual CommandObject *
GetSubcommandObject (const char *sub_cmd, StringList *matches = NULL);
virtual void
AproposAllSubCommands (const char *prefix,
const char *search_word,
StringList &commands_found,
StringList &commands_help);
virtual bool
WantsRawCommandString() { return false; };
virtual int
HandleCompletion (Args &input,
int &cursor_index,
int &cursor_char_position,
int match_start_point,
int max_return_elements,
bool &word_complete,
StringList &matches);
virtual const char *GetRepeatCommand (Args ¤t_command_args, uint32_t index);
virtual bool
Execute (const char *args_string,
CommandReturnObject &result);
virtual bool
IsRemovable() const { return m_can_be_removed; }
void
SetRemovable (bool removable)
{
m_can_be_removed = removable;
}
protected:
CommandObject::CommandMap m_subcommand_dict;
bool m_can_be_removed;
};
class CommandObjectProxy : public CommandObject
{
public:
CommandObjectProxy (CommandInterpreter &interpreter,
const char *name,
const char *help = NULL,
const char *syntax = NULL,
uint32_t flags = 0);
virtual
~CommandObjectProxy ();
virtual CommandObject *
GetProxyCommandObject() = 0;
virtual const char *
GetHelpLong ();
virtual void
AddObject (const char *obj_name);
virtual bool
IsCrossRefObject ();
virtual bool
IsRemovable() const;
virtual bool
IsMultiwordObject ();
virtual lldb::CommandObjectSP
GetSubcommandSP (const char *sub_cmd, StringList *matches = NULL);
virtual CommandObject *
GetSubcommandObject (const char *sub_cmd, StringList *matches = NULL);
virtual void
AproposAllSubCommands (const char *prefix,
const char *search_word,
StringList &commands_found,
StringList &commands_help);
virtual bool
LoadSubCommand (const char *cmd_name,
const lldb::CommandObjectSP& command_obj);
virtual bool
WantsRawCommandString();
virtual bool
WantsCompletion();
virtual Options *
GetOptions ();
virtual int
HandleCompletion (Args &input,
int &cursor_index,
int &cursor_char_position,
int match_start_point,
int max_return_elements,
bool &word_complete,
StringList &matches);
virtual int
HandleArgumentCompletion (Args &input,
int &cursor_index,
int &cursor_char_position,
OptionElementVector &opt_element_vector,
int match_start_point,
int max_return_elements,
bool &word_complete,
StringList &matches);
virtual const char *
GetRepeatCommand (Args ¤t_command_args,
uint32_t index);
virtual bool
Execute (const char *args_string,
CommandReturnObject &result);
protected:
friend class CommandInterpreter;
friend class CommandObjectSyntax;
};
}
#endif // liblldb_CommandObjectMultiword_h_