]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm-project/lldb/bindings/interface/SBTypeEnumMember.i
MFV r368464:
[FreeBSD/FreeBSD.git] / contrib / llvm-project / lldb / bindings / interface / SBTypeEnumMember.i
1 //===-- SWIG Interface for SBTypeEnumMember ---------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8
9 namespace lldb {
10
11 %feature(
12     "docstring",
13     "Represents a member of an enum in lldb."
14 ) SBTypeEnumMember;
15
16 class SBTypeEnumMember
17 {
18 public:
19     SBTypeEnumMember ();
20
21     SBTypeEnumMember (const SBTypeEnumMember& rhs);
22
23     ~SBTypeEnumMember();
24
25     bool
26     IsValid() const;
27
28     explicit operator bool() const;
29
30     int64_t
31     GetValueAsSigned();
32
33     uint64_t
34     GetValueAsUnsigned();
35
36     const char *
37     GetName ();
38
39     lldb::SBType
40     GetType ();
41
42     bool
43     GetDescription (lldb::SBStream &description,
44                     lldb::DescriptionLevel description_level);
45
46     STRING_EXTENSION_LEVEL(SBTypeEnumMember, lldb::eDescriptionLevelBrief)
47 #ifdef SWIGPYTHON
48     %pythoncode %{
49         name = property(GetName, None, doc='''A read only property that returns the name for this enum member as a string.''')
50         type = property(GetType, None, doc='''A read only property that returns an lldb object that represents the type (lldb.SBType) for this enum member.''')
51         signed = property(GetValueAsSigned, None, doc='''A read only property that returns the value of this enum member as a signed integer.''')
52         unsigned = property(GetValueAsUnsigned, None, doc='''A read only property that returns the value of this enum member as a unsigned integer.''')
53     %}
54 #endif
55
56 protected:
57     friend class SBType;
58     friend class SBTypeEnumMemberList;
59
60     void
61     reset (lldb_private::TypeEnumMemberImpl *);
62
63     lldb_private::TypeEnumMemberImpl &
64     ref ();
65
66     const lldb_private::TypeEnumMemberImpl &
67     ref () const;
68
69     lldb::TypeEnumMemberImplSP m_opaque_sp;
70
71     SBTypeEnumMember (const lldb::TypeEnumMemberImplSP &);
72 };
73
74 %feature(
75     "docstring",
76     "Represents a list of SBTypeEnumMembers."
77 ) SBTypeEnumMemberList;
78
79 class SBTypeEnumMemberList
80 {
81 public:
82     SBTypeEnumMemberList();
83
84     SBTypeEnumMemberList(const SBTypeEnumMemberList& rhs);
85
86     ~SBTypeEnumMemberList();
87
88     bool
89     IsValid();
90
91     explicit operator bool() const;
92
93     void
94     Append (SBTypeEnumMember entry);
95
96     SBTypeEnumMember
97     GetTypeEnumMemberAtIndex (uint32_t index);
98
99     uint32_t
100     GetSize();
101
102
103 private:
104     std::unique_ptr<lldb_private::TypeEnumMemberListImpl> m_opaque_ap;
105 };
106
107 } // namespace lldb