LLDB mainline
|
Annotates source code with color attributes. More...
#include <Highlighter.h>
Public Member Functions | |
Highlighter ()=default | |
virtual | ~Highlighter ()=default |
Highlighter (const Highlighter &)=delete | |
const Highlighter & | operator= (const Highlighter &)=delete |
virtual llvm::StringRef | GetName () const =0 |
Returns a human readable name for the selected highlighter. | |
virtual void | Highlight (const HighlightStyle &options, llvm::StringRef line, std::optional< size_t > cursor_pos, llvm::StringRef previous_lines, Stream &s) const =0 |
Highlights the given line. | |
std::string | Highlight (const HighlightStyle &options, llvm::StringRef line, std::optional< size_t > cursor_pos, llvm::StringRef previous_lines="") const |
Utility method for calling Highlight without a stream. |
Annotates source code with color attributes.
Definition at line 91 of file Highlighter.h.
|
default |
Referenced by Highlighter(), and operator=().
|
virtualdefault |
|
delete |
References Highlighter().
|
pure virtual |
Returns a human readable name for the selected highlighter.
Implemented in lldb_private::ClangHighlighter, and lldb_private::DefaultHighlighter.
|
pure virtual |
Highlights the given line.
options | The highlight options. |
line | The user supplied line that needs to be highlighted. |
cursor_pos | The cursor position of the user in this line, starting at 0 (which means the cursor is on the first character in 'line'). |
previous_lines | Any previous lines the user has written which we should only use for getting the context of the Highlighting right. |
s | The stream to which the highlighted version of the user string should be written. |
Implemented in lldb_private::ClangHighlighter, and lldb_private::DefaultHighlighter.
Referenced by Highlight().
std::string Highlighter::Highlight | ( | const HighlightStyle & | options, |
llvm::StringRef | line, | ||
std::optional< size_t > | cursor_pos, | ||
llvm::StringRef | previous_lines = "" ) const |
Utility method for calling Highlight without a stream.
Definition at line 74 of file Highlighter.cpp.
References lldb_private::StreamString::Flush(), lldb_private::StreamString::GetString(), and Highlight().
|
delete |
References Highlighter().