Path: blob/main/contrib/llvm-project/lldb/source/Plugins/Language/ObjC/NSDictionary.h
39642 views
//===-- NSDictionary.h ------------------------------------------*- C++ -*-===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//78#ifndef LLDB_SOURCE_PLUGINS_LANGUAGE_OBJC_NSDICTIONARY_H9#define LLDB_SOURCE_PLUGINS_LANGUAGE_OBJC_NSDICTIONARY_H1011#include "lldb/Core/ValueObject.h"12#include "lldb/DataFormatters/TypeSummary.h"13#include "lldb/DataFormatters/TypeSynthetic.h"14#include "lldb/Utility/ConstString.h"15#include "lldb/Utility/Stream.h"1617#include <map>18#include <memory>1920namespace lldb_private {21namespace formatters {22template <bool name_entries>23bool NSDictionarySummaryProvider(ValueObject &valobj, Stream &stream,24const TypeSummaryOptions &options);2526extern template bool27NSDictionarySummaryProvider<true>(ValueObject &, Stream &,28const TypeSummaryOptions &);2930extern template bool31NSDictionarySummaryProvider<false>(ValueObject &, Stream &,32const TypeSummaryOptions &);3334SyntheticChildrenFrontEnd *35NSDictionarySyntheticFrontEndCreator(CXXSyntheticChildren *,36lldb::ValueObjectSP);3738class NSDictionary_Additionals {39public:40class AdditionalFormatterMatching {41public:42class Matcher {43public:44virtual ~Matcher() = default;45virtual bool Match(ConstString class_name) = 0;4647typedef std::unique_ptr<Matcher> UP;48};49class Prefix : public Matcher {50public:51Prefix(ConstString p);52~Prefix() override = default;53bool Match(ConstString class_name) override;5455private:56ConstString m_prefix;57};58class Full : public Matcher {59public:60Full(ConstString n);61~Full() override = default;62bool Match(ConstString class_name) override;6364private:65ConstString m_name;66};67typedef Matcher::UP MatcherUP;6869MatcherUP GetFullMatch(ConstString n) { return std::make_unique<Full>(n); }7071MatcherUP GetPrefixMatch(ConstString p) {72return std::make_unique<Prefix>(p);73}74};7576template <typename FormatterType>77using AdditionalFormatter =78std::pair<AdditionalFormatterMatching::MatcherUP, FormatterType>;7980template <typename FormatterType>81using AdditionalFormatters = std::vector<AdditionalFormatter<FormatterType>>;8283static AdditionalFormatters<CXXFunctionSummaryFormat::Callback> &84GetAdditionalSummaries();8586static AdditionalFormatters<CXXSyntheticChildren::CreateFrontEndCallback> &87GetAdditionalSynthetics();88};89} // namespace formatters90} // namespace lldb_private9192#endif // LLDB_SOURCE_PLUGINS_LANGUAGE_OBJC_NSDICTIONARY_H939495