1 //===- LinePrinter.h ------------------------------------------ *- C++ --*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef LLVM_TOOLS_LLVMPDBDUMP_LINEPRINTER_H
11 #define LLVM_TOOLS_LLVMPDBDUMP_LINEPRINTER_H
13 #include "llvm/ADT/StringRef.h"
14 #include "llvm/ADT/Twine.h"
15 #include "llvm/Support/raw_ostream.h"
16 #include "llvm/Support/Regex.h"
23 friend class WithColor;
26 LinePrinter(int Indent, raw_ostream &Stream);
32 raw_ostream &getStream() { return OS; }
33 int getIndentLevel() const { return CurrentIndent; }
35 bool IsTypeExcluded(llvm::StringRef TypeName);
36 bool IsSymbolExcluded(llvm::StringRef SymbolName);
37 bool IsCompilandExcluded(llvm::StringRef CompilandName);
40 template <typename Iter>
41 void SetFilters(std::list<Regex> &List, Iter Begin, Iter End) {
43 for (; Begin != End; ++Begin)
44 List.emplace_back(StringRef(*Begin));
51 std::list<Regex> CompilandFilters;
52 std::list<Regex> TypeFilters;
53 std::list<Regex> SymbolFilters;
57 inline raw_ostream &operator<<(LinePrinter &Printer, const T &Item) {
58 Printer.getStream() << Item;
59 return Printer.getStream();
62 enum class PDB_ColorItem {
77 WithColor(LinePrinter &P, PDB_ColorItem C);
80 raw_ostream &get() { return OS; }
83 void translateColor(PDB_ColorItem C, raw_ostream::Colors &Color,