LLDB  mainline
NSDictionary.h
Go to the documentation of this file.
1 //===-- NSDictionary.h ------------------------------------------*- 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 #ifndef LLDB_SOURCE_PLUGINS_LANGUAGE_OBJC_NSDICTIONARY_H
10 #define LLDB_SOURCE_PLUGINS_LANGUAGE_OBJC_NSDICTIONARY_H
11 
12 #include "lldb/Core/ValueObject.h"
16 #include "lldb/Utility/Stream.h"
17 
18 #include <map>
19 #include <memory>
20 
21 namespace lldb_private {
22 namespace formatters {
23 template <bool name_entries>
24 bool NSDictionarySummaryProvider(ValueObject &valobj, Stream &stream,
25  const TypeSummaryOptions &options);
26 
27 extern template bool
28 NSDictionarySummaryProvider<true>(ValueObject &, Stream &,
29  const TypeSummaryOptions &);
30 
31 extern template bool
32 NSDictionarySummaryProvider<false>(ValueObject &, Stream &,
33  const TypeSummaryOptions &);
34 
35 SyntheticChildrenFrontEnd *
36 NSDictionarySyntheticFrontEndCreator(CXXSyntheticChildren *,
37  lldb::ValueObjectSP);
38 
40 public:
42  public:
43  class Matcher {
44  public:
45  virtual ~Matcher() = default;
46  virtual bool Match(ConstString class_name) = 0;
47 
48  typedef std::unique_ptr<Matcher> UP;
49  };
50  class Prefix : public Matcher {
51  public:
53  ~Prefix() override = default;
54  bool Match(ConstString class_name) override;
55 
56  private:
58  };
59  class Full : public Matcher {
60  public:
61  Full(ConstString n);
62  ~Full() override = default;
63  bool Match(ConstString class_name) override;
64 
65  private:
67  };
69 
70  MatcherUP GetFullMatch(ConstString n) { return std::make_unique<Full>(n); }
71 
73  return std::make_unique<Prefix>(p);
74  }
75  };
76 
77  template <typename FormatterType>
78  using AdditionalFormatter =
79  std::pair<AdditionalFormatterMatching::MatcherUP, FormatterType>;
80 
81  template <typename FormatterType>
82  using AdditionalFormatters = std::vector<AdditionalFormatter<FormatterType>>;
83 
85  GetAdditionalSummaries();
86 
88  GetAdditionalSynthetics();
89 };
90 } // namespace formatters
91 } // namespace lldb_private
92 
93 #endif // LLDB_SOURCE_PLUGINS_LANGUAGE_OBJC_NSDICTIONARY_H
lldb_private::formatters::NSDictionary_Additionals::AdditionalFormatterMatching::GetPrefixMatch
MatcherUP GetPrefixMatch(ConstString p)
Definition: NSDictionary.h:72
lldb_private::formatters::NSDictionarySyntheticFrontEndCreator
SyntheticChildrenFrontEnd * NSDictionarySyntheticFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP)
Definition: NSDictionary.cpp:520
lldb_private::formatters::NSDictionary_Additionals::AdditionalFormatterMatching
Definition: NSDictionary.h:41
lldb_private::formatters::NSDictionary_Additionals::AdditionalFormatterMatching::Prefix::m_prefix
ConstString m_prefix
Definition: NSDictionary.h:57
lldb_private::formatters::NSDictionary_Additionals::AdditionalFormatterMatching::Full::m_name
ConstString m_name
Definition: NSDictionary.h:66
lldb_private::ConstString
Definition: ConstString.h:40
lldb_private::formatters::NSDictionarySummaryProvider< false >
template bool NSDictionarySummaryProvider< false >(ValueObject &, Stream &, const TypeSummaryOptions &)
lldb_private::formatters::NSDictionarySummaryProvider
bool NSDictionarySummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options)
Definition: NSDictionary.cpp:411
lldb_private::formatters::NSDictionary_Additionals::AdditionalFormatters
std::vector< AdditionalFormatter< FormatterType > > AdditionalFormatters
Definition: NSDictionary.h:82
ValueObject.h
lldb_private::formatters::NSDictionarySummaryProvider< true >
template bool NSDictionarySummaryProvider< true >(ValueObject &, Stream &, const TypeSummaryOptions &)
lldb_private::formatters::NSDictionary_Additionals::AdditionalFormatterMatching::MatcherUP
Matcher::UP MatcherUP
Definition: NSDictionary.h:68
lldb_private::formatters::NSDictionary_Additionals::AdditionalFormatterMatching::Full
Definition: NSDictionary.h:59
lldb_private::formatters::NSDictionary_Additionals::AdditionalFormatterMatching::Matcher
Definition: NSDictionary.h:43
TypeSummary.h
TypeSynthetic.h
lldb_private::formatters::NSDictionary_Additionals::AdditionalFormatterMatching::GetFullMatch
MatcherUP GetFullMatch(ConstString n)
Definition: NSDictionary.h:70
lldb_private::formatters::NSDictionary_Additionals::AdditionalFormatterMatching::Prefix
Definition: NSDictionary.h:50
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
ConstString.h
Stream.h
lldb_private::formatters::NSDictionary_Additionals
Definition: NSDictionary.h:39
lldb_private::formatters::NSDictionary_Additionals::AdditionalFormatterMatching::Matcher::UP
std::unique_ptr< Matcher > UP
Definition: NSDictionary.h:48