SBCommandInterpreter.h revision 5a15e6927b5b3234fb3e688717297ba6b5dd6ad7
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 const lldb::SBCommandInterpreter & 32 operator = (const lldb::SBCommandInterpreter &rhs); 33 34 ~SBCommandInterpreter (); 35 36 static const char * 37 GetArgumentTypeAsCString (const lldb::CommandArgumentType arg_type); 38 39 static const char * 40 GetArgumentDescriptionAsCString (const lldb::CommandArgumentType arg_type); 41 42 bool 43 IsValid() const; 44 45 bool 46 CommandExists (const char *cmd); 47 48 bool 49 AliasExists (const char *cmd); 50 51 lldb::SBBroadcaster 52 GetBroadcaster (); 53 54 static const char * 55 GetBroadcasterClass (); 56 57 bool 58 HasCommands (); 59 60 bool 61 HasAliases (); 62 63 bool 64 HasAliasOptions (); 65 66 lldb::SBProcess 67 GetProcess (); 68 69 void 70 SourceInitFileInHomeDirectory (lldb::SBCommandReturnObject &result); 71 72 void 73 SourceInitFileInCurrentWorkingDirectory (lldb::SBCommandReturnObject &result); 74 75 lldb::ReturnStatus 76 HandleCommand (const char *command_line, lldb::SBCommandReturnObject &result, bool add_to_history = false); 77 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 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