SBType.h revision 8c1d7203f726e3a62b832dbeeaf0ae76f9f65222
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    void
105    Append (const SBType& type);
106
107    SBType
108    GetTypeAtIndex(int index) const;
109
110    int
111    GetSize() const;
112
113    ~SBTypeList();
114
115private:
116    std::auto_ptr<lldb_private::TypeListImpl> m_opaque_ap;
117};
118
119} // namespace lldb
120
121#endif // LLDB_SBType_h_
122