SBCommandReturnObject.h revision 63094e0bb161580564954dee512955c1c79d3476
1//===-- SBCommandReturnObject.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_SBCommandReturnObject_h_ 11#define LLDB_SBCommandReturnObject_h_ 12 13#include "lldb/API/SBDefines.h" 14 15namespace lldb { 16 17class SBCommandReturnObject 18{ 19public: 20 21 SBCommandReturnObject (); 22 23 ~SBCommandReturnObject (); 24 25 bool 26 IsValid() const; 27 28 const char * 29 GetOutput (); 30 31 const char * 32 GetError (); 33 34 size_t 35 PutOutput (FILE *fh); 36 37 size_t 38 GetOutputSize (); 39 40 size_t 41 GetErrorSize (); 42 43 size_t 44 PutError (FILE *fh); 45 46 void 47 Clear(); 48 49 lldb::ReturnStatus 50 GetStatus(); 51 52 bool 53 Succeeded (); 54 55 bool 56 HasResult (); 57 58 void 59 AppendMessage (const char *message); 60 61protected: 62 friend class SBCommandInterpreter; 63 friend class SBOptions; 64 65 66#ifndef SWIG 67 68 lldb_private::CommandReturnObject * 69 operator->() const; 70 71 lldb_private::CommandReturnObject * 72 get() const; 73 74 lldb_private::CommandReturnObject & 75 operator*() const; 76 77 lldb_private::CommandReturnObject & 78 ref() const; 79 80#endif 81 void 82 SetLLDBObjectPtr (lldb_private::CommandReturnObject *ptr); 83 84 private: 85 std::auto_ptr<lldb_private::CommandReturnObject> m_opaque_ap; 86}; 87 88} // namespace lldb 89 90#endif // LLDB_SBCommandReturnObject_h_ 91