LLDB  mainline
Public Member Functions | Private Attributes | List of all members
lldb_private::HighlightStyle::ColorStyle Class Reference

A pair of strings that should be placed around a certain token. More...

#include <Highlighter.h>

Collaboration diagram for lldb_private::HighlightStyle::ColorStyle:
Collaboration graph
[legend]

Public Member Functions

 ColorStyle ()=default
 
 ColorStyle (llvm::StringRef prefix, llvm::StringRef suffix)
 
void Apply (Stream &s, llvm::StringRef value) const
 Applies this style to the given value. More...
 
void Set (llvm::StringRef prefix, llvm::StringRef suffix)
 Sets the prefix and suffix strings. More...
 

Private Attributes

std::string m_prefix
 
std::string m_suffix
 

Detailed Description

A pair of strings that should be placed around a certain token.

Usually stores color codes in these strings (the suffix string is often used for resetting the terminal attributes back to normal).

Definition at line 28 of file Highlighter.h.

Constructor & Destructor Documentation

◆ ColorStyle() [1/2]

lldb_private::HighlightStyle::ColorStyle::ColorStyle ( )
default

◆ ColorStyle() [2/2]

lldb_private::HighlightStyle::ColorStyle::ColorStyle ( llvm::StringRef  prefix,
llvm::StringRef  suffix 
)
inline

Definition at line 34 of file Highlighter.h.

References Set().

Member Function Documentation

◆ Apply()

void HighlightStyle::ColorStyle::Apply ( Stream s,
llvm::StringRef  value 
) const

Applies this style to the given value.

Parameters
sThe stream to which the result should be appended.
valueThe value that we should place our strings around.

Definition at line 18 of file Highlighter.cpp.

Referenced by lldb_private::ClangHighlighter::Highlight(), and lldb_private::DefaultHighlighter::Highlight().

◆ Set()

void HighlightStyle::ColorStyle::Set ( llvm::StringRef  prefix,
llvm::StringRef  suffix 
)

Sets the prefix and suffix strings.

Definition at line 22 of file Highlighter.cpp.

References lldb_private::ansi::FormatAnsiTerminalCodes().

Referenced by ColorStyle(), and lldb_private::SourceManager::File::DisplaySourceLines().

Member Data Documentation

◆ m_prefix

std::string lldb_private::HighlightStyle::ColorStyle::m_prefix
private

Definition at line 29 of file Highlighter.h.

◆ m_suffix

std::string lldb_private::HighlightStyle::ColorStyle::m_suffix
private

Definition at line 30 of file Highlighter.h.


The documentation for this class was generated from the following files: