SBValue.h revision fa3a16a2ea380ef38388ebe323817bd1b32c20cd
1//===-- SBValue.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_SBValue_h_ 11#define LLDB_SBValue_h_ 12 13#include "lldb/API/SBDefines.h" 14 15#include <stdio.h> 16 17namespace lldb { 18 19class SBValue 20{ 21public: 22 SBValue (); 23 24 SBValue (const SBValue &rhs); 25 26#ifndef SWIG 27 const SBValue & 28 operator =(const SBValue &rhs); 29#endif 30 31 ~SBValue (); 32 33 bool 34 IsValid() const; 35 36 SBError 37 GetError(); 38 39 const char * 40 GetName(); 41 42 const char * 43 GetTypeName (); 44 45 size_t 46 GetByteSize (); 47 48 bool 49 IsInScope (const lldb::SBFrame &frame); // DEPRECATED - SBValues know their own frames. 50 51 bool 52 IsInScope (); 53 54 lldb::Format 55 GetFormat () const; 56 57 void 58 SetFormat (lldb::Format format); 59 60 const char * 61 GetValue (const lldb::SBFrame &frame); // DEPRECATED - SBValues know their own frames. 62 63 const char * 64 GetValue (); 65 66 ValueType 67 GetValueType (); 68 69 bool 70 GetValueDidChange (const lldb::SBFrame &frame); // DEPRECATED - SBValues know their own frames. 71 72 bool 73 GetValueDidChange (); 74 75 const char * 76 GetSummary (const lldb::SBFrame &frame); // DEPRECATED - SBValues know their own frames. 77 78 const char * 79 GetSummary (); 80 81 const char * 82 GetObjectDescription (const lldb::SBFrame &frame); // DEPRECATED - SBValues know their own frames. 83 84 const char * 85 GetObjectDescription (); 86 87 const char * 88 GetLocation (const lldb::SBFrame &frame); // DEPRECATED - SBValues know their own frames. 89 90 const char * 91 GetLocation (); 92 93 bool 94 SetValueFromCString (const lldb::SBFrame &frame, const char *value_str); // DEPRECATED - SBValues know their own frames. 95 96 bool 97 SetValueFromCString (const char *value_str); 98 99 lldb::SBValue 100 GetChildAtIndex (uint32_t idx); 101 102 // Matches children of this object only and will match base classes and 103 // member names if this is a clang typed object. 104 uint32_t 105 GetIndexOfChildWithName (const char *name); 106 107 // Matches child members of this object and child members of any base 108 // classes. 109 lldb::SBValue 110 GetChildMemberWithName (const char *name); 111 112 uint32_t 113 GetNumChildren (); 114 115 void * 116 GetOpaqueType(); 117 118 119 lldb::SBValue 120 Dereference (); 121 122 bool 123 TypeIsPointerType (); 124 125 bool 126 GetDescription (lldb::SBStream &description); 127 128 bool 129 GetExpressionPath (lldb::SBStream &description); 130 131 bool 132 GetExpressionPath (lldb::SBStream &description, bool qualify_cxx_base_classes); 133 134protected: 135 friend class SBValueList; 136 friend class SBFrame; 137 138 SBValue (const lldb::ValueObjectSP &value_sp); 139 140#ifndef SWIG 141 142 // Mimic shared pointer... 143 lldb_private::ValueObject * 144 get() const; 145 146 lldb_private::ValueObject * 147 operator->() const; 148 149 lldb::ValueObjectSP & 150 operator*(); 151 152 const lldb::ValueObjectSP & 153 operator*() const; 154 155#endif 156 157private: 158 lldb::ValueObjectSP m_opaque_sp; 159}; 160 161} // namespace lldb 162 163#endif // LLDB_SBValue_h_ 164