1 //===-- SWIG Interface for SBCommandReturnObject ----------------*- 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 namespace lldb { 11 12 %feature("docstring", 13 "Represents a container which holds the result from command execution. 14 It works with SBCommandInterpreter.HandleCommand() to encapsulate the result 15 of command execution. 16 17 See SBCommandInterpreter for example usage of SBCommandReturnObject." 18 ) SBCommandReturnObject; 19 class SBCommandReturnObject 20 { 21 public: 22 23 SBCommandReturnObject (); 24 25 SBCommandReturnObject (const lldb::SBCommandReturnObject &rhs); 26 27 ~SBCommandReturnObject (); 28 29 bool 30 IsValid() const; 31 32 const char * 33 GetOutput (); 34 35 const char * 36 GetError (); 37 38 size_t 39 GetOutputSize (); 40 41 size_t 42 GetErrorSize (); 43 44 const char * 45 GetOutput (bool only_if_no_immediate); 46 47 const char * 48 GetError (bool if_no_immediate); 49 50 size_t 51 PutOutput (FILE *fh); 52 53 size_t 54 PutError (FILE *fh); 55 56 void 57 Clear(); 58 59 void 60 SetStatus (lldb::ReturnStatus status); 61 62 void 63 SetError (lldb::SBError &error, 64 const char *fallback_error_cstr = NULL); 65 66 void 67 SetError (const char *error_cstr); 68 69 lldb::ReturnStatus 70 GetStatus(); 71 72 bool 73 Succeeded (); 74 75 bool 76 HasResult (); 77 78 void 79 AppendMessage (const char *message); 80 81 void 82 AppendWarning (const char *message); 83 84 bool 85 GetDescription (lldb::SBStream &description); 86 87 void 88 SetImmediateOutputFile (FILE *fh); 89 90 void 91 SetImmediateErrorFile (FILE *fh); 92 93 void 94 PutCString(const char* string, int len); 95 96 // wrapping the variadic Printf() with a plain Print() 97 // because it is hard to support varargs in SWIG bridgings 98 %extend { 99 void Print (const char* str) 100 { 101 self->Printf("%s", str); 102 } 103 } 104 105 }; 106 107 } // namespace lldb 108