1 //===-- SBTypeCategory.h --------------------------------------------*- C++
2 //-*-===//
3 //
4 //                     The LLVM Compiler Infrastructure
5 //
6 // This file is distributed under the University of Illinois Open Source
7 // License. See LICENSE.TXT for details.
8 //
9 //===----------------------------------------------------------------------===//
10 
11 #ifndef LLDB_SBTypeCategory_h_
12 #define LLDB_SBTypeCategory_h_
13 
14 #include "lldb/API/SBDefines.h"
15 
16 namespace lldb {
17 
18 class LLDB_API SBTypeCategory {
19 public:
20   SBTypeCategory();
21 
22   SBTypeCategory(const lldb::SBTypeCategory &rhs);
23 
24   ~SBTypeCategory();
25 
26   bool IsValid() const;
27 
28   bool GetEnabled();
29 
30   void SetEnabled(bool);
31 
32   const char *GetName();
33 
34   lldb::LanguageType GetLanguageAtIndex(uint32_t idx);
35 
36   uint32_t GetNumLanguages();
37 
38   void AddLanguage(lldb::LanguageType language);
39 
40   bool GetDescription(lldb::SBStream &description,
41                       lldb::DescriptionLevel description_level);
42 
43   uint32_t GetNumFormats();
44 
45   uint32_t GetNumSummaries();
46 
47   uint32_t GetNumFilters();
48 
49 #ifndef LLDB_DISABLE_PYTHON
50   uint32_t GetNumSynthetics();
51 #endif
52 
53   SBTypeNameSpecifier GetTypeNameSpecifierForFilterAtIndex(uint32_t);
54 
55   SBTypeNameSpecifier GetTypeNameSpecifierForFormatAtIndex(uint32_t);
56 
57   SBTypeNameSpecifier GetTypeNameSpecifierForSummaryAtIndex(uint32_t);
58 
59 #ifndef LLDB_DISABLE_PYTHON
60   SBTypeNameSpecifier GetTypeNameSpecifierForSyntheticAtIndex(uint32_t);
61 #endif
62 
63   SBTypeFilter GetFilterForType(SBTypeNameSpecifier);
64 
65   SBTypeFormat GetFormatForType(SBTypeNameSpecifier);
66 
67 #ifndef LLDB_DISABLE_PYTHON
68   SBTypeSummary GetSummaryForType(SBTypeNameSpecifier);
69 #endif
70 
71 #ifndef LLDB_DISABLE_PYTHON
72   SBTypeSynthetic GetSyntheticForType(SBTypeNameSpecifier);
73 #endif
74 
75 #ifndef LLDB_DISABLE_PYTHON
76   SBTypeFilter GetFilterAtIndex(uint32_t);
77 #endif
78 
79   SBTypeFormat GetFormatAtIndex(uint32_t);
80 
81 #ifndef LLDB_DISABLE_PYTHON
82   SBTypeSummary GetSummaryAtIndex(uint32_t);
83 #endif
84 
85 #ifndef LLDB_DISABLE_PYTHON
86   SBTypeSynthetic GetSyntheticAtIndex(uint32_t);
87 #endif
88 
89   bool AddTypeFormat(SBTypeNameSpecifier, SBTypeFormat);
90 
91   bool DeleteTypeFormat(SBTypeNameSpecifier);
92 
93 #ifndef LLDB_DISABLE_PYTHON
94   bool AddTypeSummary(SBTypeNameSpecifier, SBTypeSummary);
95 #endif
96 
97   bool DeleteTypeSummary(SBTypeNameSpecifier);
98 
99   bool AddTypeFilter(SBTypeNameSpecifier, SBTypeFilter);
100 
101   bool DeleteTypeFilter(SBTypeNameSpecifier);
102 
103 #ifndef LLDB_DISABLE_PYTHON
104   bool AddTypeSynthetic(SBTypeNameSpecifier, SBTypeSynthetic);
105 
106   bool DeleteTypeSynthetic(SBTypeNameSpecifier);
107 #endif
108 
109   lldb::SBTypeCategory &operator=(const lldb::SBTypeCategory &rhs);
110 
111   bool operator==(lldb::SBTypeCategory &rhs);
112 
113   bool operator!=(lldb::SBTypeCategory &rhs);
114 
115 protected:
116   friend class SBDebugger;
117 
118   lldb::TypeCategoryImplSP GetSP();
119 
120   void SetSP(const lldb::TypeCategoryImplSP &typecategory_impl_sp);
121 
122   TypeCategoryImplSP m_opaque_sp;
123 
124   SBTypeCategory(const lldb::TypeCategoryImplSP &);
125 
126   SBTypeCategory(const char *);
127 
128   bool IsDefaultCategory();
129 };
130 
131 } // namespace lldb
132 
133 #endif // LLDB_SBTypeCategory_h_
134