1 //===-- NSDictionary.h ------------------------------------------*- C++ -*-===//
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
7 //===----------------------------------------------------------------------===//
9 #ifndef LLDB_SOURCE_PLUGINS_LANGUAGE_OBJC_NSDICTIONARY_H
10 #define LLDB_SOURCE_PLUGINS_LANGUAGE_OBJC_NSDICTIONARY_H
12 #include "lldb/Core/ValueObject.h"
13 #include "lldb/DataFormatters/TypeSummary.h"
14 #include "lldb/DataFormatters/TypeSynthetic.h"
15 #include "lldb/Utility/ConstString.h"
16 #include "lldb/Utility/Stream.h"
21 namespace lldb_private
{
22 namespace formatters
{
23 template <bool name_entries
>
24 bool NSDictionarySummaryProvider(ValueObject
&valobj
, Stream
&stream
,
25 const TypeSummaryOptions
&options
);
28 NSDictionarySummaryProvider
<true>(ValueObject
&, Stream
&,
29 const TypeSummaryOptions
&);
32 NSDictionarySummaryProvider
<false>(ValueObject
&, Stream
&,
33 const TypeSummaryOptions
&);
35 SyntheticChildrenFrontEnd
*
36 NSDictionarySyntheticFrontEndCreator(CXXSyntheticChildren
*,
39 class NSDictionary_Additionals
{
41 class AdditionalFormatterMatching
{
45 virtual ~Matcher() = default;
46 virtual bool Match(ConstString class_name
) = 0;
48 typedef std::unique_ptr
<Matcher
> UP
;
50 class Prefix
: public Matcher
{
52 Prefix(ConstString p
);
53 ~Prefix() override
= default;
54 bool Match(ConstString class_name
) override
;
59 class Full
: public Matcher
{
62 ~Full() override
= default;
63 bool Match(ConstString class_name
) override
;
68 typedef Matcher::UP MatcherUP
;
70 MatcherUP
GetFullMatch(ConstString n
) { return std::make_unique
<Full
>(n
); }
72 MatcherUP
GetPrefixMatch(ConstString p
) {
73 return std::make_unique
<Prefix
>(p
);
77 template <typename FormatterType
>
78 using AdditionalFormatter
=
79 std::pair
<AdditionalFormatterMatching::MatcherUP
, FormatterType
>;
81 template <typename FormatterType
>
82 using AdditionalFormatters
= std::vector
<AdditionalFormatter
<FormatterType
>>;
84 static AdditionalFormatters
<CXXFunctionSummaryFormat::Callback
> &
85 GetAdditionalSummaries();
87 static AdditionalFormatters
<CXXSyntheticChildren::CreateFrontEndCallback
> &
88 GetAdditionalSynthetics();
90 } // namespace formatters
91 } // namespace lldb_private
93 #endif // LLDB_SOURCE_PLUGINS_LANGUAGE_OBJC_NSDICTIONARY_H