reference, declarationdefinition
definition → references, declarations, derived classes, virtual overrides
reference to multiple definitions → definitions
unreferenced
    1
    2
    3
    4
    5
    6
    7
    8
    9
   10
   11
   12
   13
   14
   15
   16
   17
   18
   19
   20
   21
   22
   23
   24
   25
   26
   27
   28
   29
   30
   31
   32
   33
   34
   35
   36
   37
   38
   39
   40
   41
   42
   43
   44
   45
   46
   47
   48
   49
   50
   51
   52
   53
   54
   55
   56
   57
   58
   59
   60
   61
   62
   63
   64
   65
   66
   67
   68
   69
   70
   71
   72
   73
   74
   75
//===-- LanguageCategory.h----------------------------------------*- C++
//-*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#ifndef lldb_LanguageCategory_h_
#define lldb_LanguageCategory_h_


#include "lldb/DataFormatters/FormatCache.h"
#include "lldb/DataFormatters/FormatClasses.h"
#include "lldb/lldb-public.h"

#include <memory>

namespace lldb_private {

class LanguageCategory {
public:
  typedef std::unique_ptr<LanguageCategory> UniquePointer;

  LanguageCategory(lldb::LanguageType lang_type);

  bool Get(FormattersMatchData &match_data, lldb::TypeFormatImplSP &format_sp);

  bool Get(FormattersMatchData &match_data, lldb::TypeSummaryImplSP &format_sp);

  bool Get(FormattersMatchData &match_data,
           lldb::SyntheticChildrenSP &format_sp);

  bool Get(FormattersMatchData &match_data,
           lldb::TypeValidatorImplSP &format_sp);

  bool GetHardcoded(FormatManager &fmt_mgr, FormattersMatchData &match_data,
                    lldb::TypeFormatImplSP &format_sp);

  bool GetHardcoded(FormatManager &fmt_mgr, FormattersMatchData &match_data,
                    lldb::TypeSummaryImplSP &format_sp);

  bool GetHardcoded(FormatManager &fmt_mgr, FormattersMatchData &match_data,
                    lldb::SyntheticChildrenSP &format_sp);

  bool GetHardcoded(FormatManager &fmt_mgr, FormattersMatchData &match_data,
                    lldb::TypeValidatorImplSP &format_sp);

  lldb::TypeCategoryImplSP GetCategory() const;

  FormatCache &GetFormatCache();

  void Enable();

  void Disable();

  bool IsEnabled();

private:
  lldb::TypeCategoryImplSP m_category_sp;

  HardcodedFormatters::HardcodedFormatFinder m_hardcoded_formats;
  HardcodedFormatters::HardcodedSummaryFinder m_hardcoded_summaries;
  HardcodedFormatters::HardcodedSyntheticFinder m_hardcoded_synthetics;
  HardcodedFormatters::HardcodedValidatorFinder m_hardcoded_validators;

  lldb_private::FormatCache m_format_cache;

  bool m_enabled;
};

} // namespace lldb_private

#endif // lldb_LanguageCategory_h_