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