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