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>

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.
 
void Set (llvm::StringRef prefix, llvm::StringRef suffix)
 Sets the prefix and suffix strings.
 

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 29 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 35 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 19 of file Highlighter.cpp.

References m_prefix, and m_suffix.

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

◆ Set()

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

Sets the prefix and suffix strings.

Definition at line 23 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 30 of file Highlighter.h.

Referenced by Apply().

◆ m_suffix

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

Definition at line 31 of file Highlighter.h.

Referenced by Apply().


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