SBCommandInterpreter.h revision 177bc682e2b45354e8b0753e705dc84255c42173
1//===-- SBCommandInterpreter.h ----------------------------------*- C++ -*-===// 2// 3// The LLVM Compiler Infrastructure 4// 5// This file is distributed under the University of Illinois Open Source 6// License. See LICENSE.TXT for details. 7// 8//===----------------------------------------------------------------------===// 9 10#ifndef LLDB_SBCommandInterpreter_h_ 11#define LLDB_SBCommandInterpreter_h_ 12 13#include "lldb/API/SBDefines.h" 14 15namespace lldb { 16 17class SBCommandInterpreter 18{ 19public: 20 enum 21 { 22 eBroadcastBitThreadShouldExit = (1 << 0), 23 eBroadcastBitResetPrompt = (1 << 1), 24 eBroadcastBitQuitCommandReceived = (1 << 2), // User entered quit 25 eBroadcastBitAsynchronousOutputData = (1 << 3), 26 eBroadcastBitAsynchronousErrorData = (1 << 4) 27 }; 28 29 SBCommandInterpreter (const lldb::SBCommandInterpreter &rhs); 30 31#ifndef SWIG 32 const lldb::SBCommandInterpreter & 33 operator = (const lldb::SBCommandInterpreter &rhs); 34#endif 35 36 ~SBCommandInterpreter (); 37 38 static const char * 39 GetArgumentTypeAsCString (const lldb::CommandArgumentType arg_type); 40 41 static const char * 42 GetArgumentDescriptionAsCString (const lldb::CommandArgumentType arg_type); 43 44 bool 45 IsValid() const; 46 47 bool 48 CommandExists (const char *cmd); 49 50 bool 51 AliasExists (const char *cmd); 52 53 lldb::SBBroadcaster 54 GetBroadcaster (); 55 56 bool 57 HasCommands (); 58 59 bool 60 HasAliases (); 61 62 bool 63 HasAliasOptions (); 64 65 lldb::SBProcess 66 GetProcess (); 67 68 void 69 SourceInitFileInHomeDirectory (lldb::SBCommandReturnObject &result); 70 71 void 72 SourceInitFileInCurrentWorkingDirectory (lldb::SBCommandReturnObject &result); 73 74 lldb::ReturnStatus 75 HandleCommand (const char *command_line, lldb::SBCommandReturnObject &result, bool add_to_history = false); 76 77#ifndef SWIG 78 // This interface is not useful in SWIG, since the cursor & last_char arguments are string pointers INTO current_line 79 // and you can't do that in a scripting language interface in general... 80 int 81 HandleCompletion (const char *current_line, 82 const char *cursor, 83 const char *last_char, 84 int match_start_point, 85 int max_return_elements, 86 lldb::SBStringList &matches); 87#endif 88 int 89 HandleCompletion (const char *current_line, 90 uint32_t cursor_pos, 91 int match_start_point, 92 int max_return_elements, 93 lldb::SBStringList &matches); 94 95protected: 96 97 lldb_private::CommandInterpreter & 98 ref (); 99 100 lldb_private::CommandInterpreter * 101 get (); 102 103 void 104 reset (lldb_private::CommandInterpreter *); 105private: 106 friend class SBDebugger; 107 108 SBCommandInterpreter (lldb_private::CommandInterpreter *interpreter_ptr = NULL); // Access using SBDebugger::GetCommandInterpreter(); 109 110 static void 111 InitializeSWIG (); 112 113 lldb_private::CommandInterpreter *m_opaque_ptr; 114}; 115 116 117} // namespace lldb 118 119#endif // LLDB_SBCommandInterpreter_h_ 120