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
14#include "lldb/Utility/Stream.h"
16
17#include <map>
18#include <memory>
19
20namespace lldb_private {
21namespace formatters {
22template <bool name_entries>
23bool NSDictionarySummaryProvider(ValueObject &valobj, Stream &stream,
24 const TypeSummaryOptions &options);
25
26extern template bool
28 const TypeSummaryOptions &);
29
30extern template bool
32 const TypeSummaryOptions &);
33
37
39public:
41 public:
42 class Matcher {
43 public:
44 virtual ~Matcher() = default;
45 virtual bool Match(llvm::StringRef class_name) = 0;
46
47 typedef std::unique_ptr<Matcher> UP;
48 };
49 class Prefix : public Matcher {
50 public:
51 Prefix(std::string p);
52 ~Prefix() override = default;
53 bool Match(llvm::StringRef class_name) override;
54
55 private:
56 std::string m_prefix;
57 };
58 class Full : public Matcher {
59 public:
60 Full(std::string n);
61 ~Full() override = default;
62 bool Match(llvm::StringRef class_name) override;
63
64 private:
65 std::string m_name;
66 };
68
69 MatcherUP GetFullMatch(llvm::StringRef n) {
70 return std::make_unique<Full>(n.str());
71 }
72
73 MatcherUP GetPrefixMatch(llvm::StringRef p) {
74 return std::make_unique<Prefix>(p.str());
75 }
76 };
77
78 template <typename FormatterType>
80 std::pair<AdditionalFormatterMatching::MatcherUP, FormatterType>;
81
82 template <typename FormatterType>
83 using AdditionalFormatters = std::vector<AdditionalFormatter<FormatterType>>;
84
87
90};
91} // namespace formatters
92} // namespace lldb_private
93
94#endif // LLDB_SOURCE_PLUGINS_LANGUAGE_OBJC_NSDICTIONARY_H
A stream class that can stream formatted output to a file.
Definition Stream.h:28
std::pair< AdditionalFormatterMatching::MatcherUP, FormatterType > AdditionalFormatter
static AdditionalFormatters< CXXFunctionSummaryFormat::Callback > & GetAdditionalSummaries()
static AdditionalFormatters< CXXSyntheticChildren::CreateFrontEndCallback > & GetAdditionalSynthetics()
std::vector< AdditionalFormatter< FormatterType > > AdditionalFormatters
template bool NSDictionarySummaryProvider< false >(ValueObject &, Stream &, const TypeSummaryOptions &)
template bool NSDictionarySummaryProvider< true >(ValueObject &, Stream &, const TypeSummaryOptions &)
bool NSDictionarySummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options)
SyntheticChildrenFrontEnd * NSDictionarySyntheticFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP)
A class that represents a running process on the host machine.
std::shared_ptr< lldb_private::ValueObject > ValueObjectSP