SBType.h revision 0c64baff28c9340f84fa566df1bf9426ddd2dc31
1//===-- SBType.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_SBType_h_
11#define LLDB_SBType_h_
12
13#include "lldb/API/SBDefines.h"
14
15namespace lldb {
16
17class SBTypeList;
18
19class SBType
20{
21public:
22
23    SBType (const SBType &rhs);
24
25    ~SBType ();
26
27#ifndef SWIG
28    const lldb::SBType &
29    operator = (const lldb::SBType &rhs);
30
31    bool
32    operator == (const lldb::SBType &rhs) const;
33
34    bool
35    operator != (const lldb::SBType &rhs) const;
36
37    lldb_private::TypeImpl &
38    ref ();
39
40    const lldb_private::TypeImpl &
41    ref () const;
42
43#endif
44
45    bool
46    IsValid() const;
47
48    size_t
49    GetByteSize() const;
50
51    bool
52    IsPointerType() const;
53
54    bool
55    IsReferenceType() const;
56
57    SBType
58    GetPointerType() const;
59
60    SBType
61    GetPointeeType() const;
62
63    SBType
64    GetReferenceType() const;
65
66    SBType
67    GetDereferencedType() const;
68
69    SBType
70    GetBasicType(lldb::BasicType type) const;
71
72    const char*
73    GetName();
74
75    // DEPRECATED: but needed for Xcode right now
76    static bool
77    IsPointerType (void * clang_type);
78
79protected:
80    lldb::TypeImplSP m_opaque_sp;
81
82    friend class SBModule;
83    friend class SBTarget;
84    friend class SBValue;
85    friend class SBTypeList;
86
87    SBType (const lldb_private::ClangASTType &);
88    SBType (const lldb::TypeSP &);
89    SBType (const lldb::TypeImplSP &);
90    SBType();
91
92};
93
94class SBTypeList
95{
96public:
97    SBTypeList();
98
99    SBTypeList(const SBTypeList& rhs);
100
101    SBTypeList&
102    operator = (const SBTypeList& rhs);
103
104    bool
105    IsValid() const;
106
107    void
108    Append (const SBType& type);
109
110    SBType
111    GetTypeAtIndex(int index) const;
112
113    int
114    GetSize() const;
115
116    ~SBTypeList();
117
118private:
119    std::auto_ptr<lldb_private::TypeListImpl> m_opaque_ap;
120};
121
122} // namespace lldb
123
124#endif // LLDB_SBType_h_
125