]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm-project/lldb/include/lldb/API/SBTypeEnumMember.h
Merge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp
[FreeBSD/FreeBSD.git] / contrib / llvm-project / lldb / include / lldb / API / SBTypeEnumMember.h
1
2 //===-- SBTypeEnumMember.h --------------------------------------*- C++ -*-===//
3 //
4 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5 // See https://llvm.org/LICENSE.txt for license information.
6 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //
8 //===----------------------------------------------------------------------===//
9
10 #ifndef LLDB_SBTypeEnumMember_h_
11 #define LLDB_SBTypeEnumMember_h_
12
13 #include "lldb/API/SBDefines.h"
14
15 namespace lldb {
16
17 class LLDB_API SBTypeEnumMember {
18 public:
19   SBTypeEnumMember();
20
21   SBTypeEnumMember(const SBTypeEnumMember &rhs);
22
23   ~SBTypeEnumMember();
24
25   SBTypeEnumMember &operator=(const SBTypeEnumMember &rhs);
26
27   explicit operator bool() const;
28
29   bool IsValid() const;
30
31   int64_t GetValueAsSigned();
32
33   uint64_t GetValueAsUnsigned();
34
35   const char *GetName();
36
37   lldb::SBType GetType();
38
39   bool GetDescription(lldb::SBStream &description,
40                       lldb::DescriptionLevel description_level);
41
42 protected:
43   friend class SBType;
44   friend class SBTypeEnumMemberList;
45
46   void reset(lldb_private::TypeEnumMemberImpl *);
47
48   lldb_private::TypeEnumMemberImpl &ref();
49
50   const lldb_private::TypeEnumMemberImpl &ref() const;
51
52   lldb::TypeEnumMemberImplSP m_opaque_sp;
53
54   SBTypeEnumMember(const lldb::TypeEnumMemberImplSP &);
55 };
56
57 class SBTypeEnumMemberList {
58 public:
59   SBTypeEnumMemberList();
60
61   SBTypeEnumMemberList(const SBTypeEnumMemberList &rhs);
62
63   ~SBTypeEnumMemberList();
64
65   SBTypeEnumMemberList &operator=(const SBTypeEnumMemberList &rhs);
66
67   explicit operator bool() const;
68
69   bool IsValid();
70
71   void Append(SBTypeEnumMember entry);
72
73   SBTypeEnumMember GetTypeEnumMemberAtIndex(uint32_t index);
74
75   uint32_t GetSize();
76
77 private:
78   std::unique_ptr<lldb_private::TypeEnumMemberListImpl> m_opaque_up;
79 };
80
81 } // namespace lldb
82
83 #endif // LLDB_SBTypeEnumMember_h_