clang-tools  9.0.0
Classes | Public Member Functions | List of all members
clang::clangd::FormattedString Class Reference

A structured string representation that could be converted to markdown or plaintext upon requrest. More...

#include <FormattedString.h>

Public Member Functions

void appendText (std::string Text)
 Append plain text to the end of the string. More...
 
void appendCodeBlock (std::string Code, std::string Language="cpp")
 Append a block of C++ code. More...
 
void appendInlineCode (std::string Code)
 Append an inline block of C++ code. More...
 
std::string renderAsMarkdown () const
 
std::string renderAsPlainText () const
 
std::string renderForTests () const
 

Detailed Description

A structured string representation that could be converted to markdown or plaintext upon requrest.

Definition at line 24 of file FormattedString.h.

Member Function Documentation

◆ appendCodeBlock()

void clang::clangd::FormattedString::appendCodeBlock ( std::string  Code,
std::string  Language = "cpp" 
)

Append a block of C++ code.

This translates to a ``` block in markdown. In a plain text representation, the code block will be surrounded by newlines.

Referenced by clang::clangd::HoverInfo::present().

◆ appendInlineCode()

void clang::clangd::FormattedString::appendInlineCode ( std::string  Code)

Append an inline block of C++ code.

This translates to the ` block in markdown.

Referenced by clang::clangd::HoverInfo::present().

◆ appendText()

void clang::clangd::FormattedString::appendText ( std::string  Text)

Append plain text to the end of the string.

Referenced by clang::clangd::HoverInfo::present().

◆ renderAsMarkdown()

std::string clang::clangd::FormattedString::renderAsMarkdown ( ) const

◆ renderAsPlainText()

std::string clang::clangd::FormattedString::renderAsPlainText ( ) const

◆ renderForTests()

std::string clang::clangd::FormattedString::renderForTests ( ) const

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