]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm-project/lldb/include/lldb/DataFormatters/LanguageCategory.h
MFV r356163,r356197:
[FreeBSD/FreeBSD.git] / contrib / llvm-project / lldb / include / lldb / DataFormatters / LanguageCategory.h
1 //===-- LanguageCategory.h----------------------------------------*- C++
2 //-*-===//
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_LanguageCategory_h_
11 #define lldb_LanguageCategory_h_
12
13
14 #include "lldb/DataFormatters/FormatCache.h"
15 #include "lldb/DataFormatters/FormatClasses.h"
16 #include "lldb/lldb-public.h"
17
18 #include <memory>
19
20 namespace lldb_private {
21
22 class LanguageCategory {
23 public:
24   typedef std::unique_ptr<LanguageCategory> UniquePointer;
25
26   LanguageCategory(lldb::LanguageType lang_type);
27
28   bool Get(FormattersMatchData &match_data, lldb::TypeFormatImplSP &format_sp);
29
30   bool Get(FormattersMatchData &match_data, lldb::TypeSummaryImplSP &format_sp);
31
32   bool Get(FormattersMatchData &match_data,
33            lldb::SyntheticChildrenSP &format_sp);
34
35   bool Get(FormattersMatchData &match_data,
36            lldb::TypeValidatorImplSP &format_sp);
37
38   bool GetHardcoded(FormatManager &fmt_mgr, FormattersMatchData &match_data,
39                     lldb::TypeFormatImplSP &format_sp);
40
41   bool GetHardcoded(FormatManager &fmt_mgr, FormattersMatchData &match_data,
42                     lldb::TypeSummaryImplSP &format_sp);
43
44   bool GetHardcoded(FormatManager &fmt_mgr, FormattersMatchData &match_data,
45                     lldb::SyntheticChildrenSP &format_sp);
46
47   bool GetHardcoded(FormatManager &fmt_mgr, FormattersMatchData &match_data,
48                     lldb::TypeValidatorImplSP &format_sp);
49
50   lldb::TypeCategoryImplSP GetCategory() const;
51
52   FormatCache &GetFormatCache();
53
54   void Enable();
55
56   void Disable();
57
58   bool IsEnabled();
59
60 private:
61   lldb::TypeCategoryImplSP m_category_sp;
62
63   HardcodedFormatters::HardcodedFormatFinder m_hardcoded_formats;
64   HardcodedFormatters::HardcodedSummaryFinder m_hardcoded_summaries;
65   HardcodedFormatters::HardcodedSyntheticFinder m_hardcoded_synthetics;
66   HardcodedFormatters::HardcodedValidatorFinder m_hardcoded_validators;
67
68   lldb_private::FormatCache m_format_cache;
69
70   bool m_enabled;
71 };
72
73 } // namespace lldb_private
74
75 #endif // lldb_LanguageCategory_h_