SBType.h revision 538eb82a89a68dbc57251915080bd5152b333978
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 SBTypeMember;
18
19class SBType
20{
21public:
22
23    SBType (void *ast = NULL, void *clang_type = NULL);
24
25    SBType (const SBType &rhs);
26
27    ~SBType ();
28
29#ifndef SWIG
30    const SBType &
31    operator =(const SBType &rhs);
32#endif
33
34    bool
35    IsValid();
36
37    const char *
38    GetName();
39
40    uint64_t
41    GetByteSize();
42
43	lldb::Encoding
44    GetEncoding (uint32_t &count);
45
46    uint64_t
47    GetNumberChildren (bool omit_empty_base_classes);
48
49    bool
50    GetChildAtIndex (bool omit_empty_base_classes, uint32_t idx, SBTypeMember &member);
51
52    uint32_t
53    GetChildIndexForName (bool omit_empty_base_classes, const char *name);
54
55    bool
56    IsPointerType ();
57
58    SBType
59    GetPointeeType ();
60
61    static bool
62    IsPointerType (void *opaque_type);
63
64    bool
65    GetDescription (lldb::SBStream &description);
66
67protected:
68    void *m_ast;
69    void *m_type;
70};
71
72class SBTypeMember
73{
74public:
75
76    SBTypeMember ();
77
78    SBTypeMember (const SBTypeMember &rhs);
79
80#ifndef SWIG
81    const SBTypeMember&
82    operator =(const SBTypeMember &rhs);
83#endif
84
85    ~SBTypeMember ();
86
87    bool
88    IsBaseClass ();
89
90    bool
91    IsValid ();
92
93    void
94    Clear();
95
96    bool
97    IsBitfield ();
98
99    size_t
100    GetBitfieldWidth ();
101
102    size_t
103    GetBitfieldOffset ();
104
105    size_t
106    GetOffset ();
107
108    const char *
109    GetName ();
110
111    SBType
112    GetType();
113
114    SBType
115    GetParentType();
116
117    void
118    SetName (const char *name);
119
120protected:
121    friend class SBType;
122
123    void *m_ast;
124    void *m_parent_type;
125    void *m_member_type;
126    char *m_member_name;
127    int32_t m_offset;
128    uint32_t m_bit_size;
129    uint32_t m_bit_offset;
130    bool m_is_base_class;
131};
132
133
134} // namespace lldb
135
136#endif // LLDB_SBType_h_
137