GCC Middle and Back End API Reference
to_text Struct Reference
Collaboration diagram for to_text:

Data Structures

struct  auto_check_tag_nesting

Public Member Functions

 to_text (pretty_printer &pp, colorizer &colorizer)
 to_text (pretty_printer &pp, colorizer *colorizer)
 ~to_text ()
void emit_text_prefix ()
void push_html_tag (std::string, bool)
void push_html_tag_with_class (std::string, std::string, bool)
void pop_html_tag (const char *)
void add_html_tag_with_class (std::string, std::string, bool)
void add_space ()
void add_character (cppchar_t ch)
void add_utf8_byte (char b)
void add_text (const char *text)
void print_decoded_char (const char_display_policy &char_policy, cpp_decoded_char cp)
void colorize_text_ensure_normal ()
void colorize_text_for_range_idx (int range_idx)
void colorize_text_for_cfg_edge ()
void colorize_text_for_fixit_insert ()
void colorize_text_for_fixit_delete ()
void invoke_start_span_fn (const diagnostic_source_print_policy &source_policy, const diagnostic_location_print_policy &loc_policy, const expanded_location &exploc)
void add_newline ()

Static Public Member Functions

static bool is_text ()
static bool is_html ()

Data Fields

pretty_printerm_pp

Private Attributes

colorizer * m_colorizer
diagnostic_prefixing_rule_t m_saved_rule

Friends

class layout_printer< to_text >

Detailed Description

This code is written generically to write either: - text, to a pretty_printer, potentially with colorization codes, or - html, to an xml::printer, with nested HTML tags. This is handled via a "Sink" template, which is either to_text or to_html.
Writing text output.

Constructor & Destructor Documentation

◆ to_text() [1/2]

◆ to_text() [2/2]

to_text::to_text ( pretty_printer & pp,
colorizer * colorizer )
inline

◆ ~to_text()

to_text::~to_text ( )
inline

Member Function Documentation

◆ add_character()

void to_text::add_character ( cppchar_t ch)
inline

References m_pp, and pp_unicode_character().

◆ add_html_tag_with_class()

void to_text::add_html_tag_with_class ( std::string ,
std::string ,
bool  )
inline

◆ add_newline()

void to_text::add_newline ( )
inline

References m_pp, and pp_newline().

◆ add_space()

void to_text::add_space ( )
inline

References m_pp, and pp_space.

◆ add_text()

void to_text::add_text ( const char * text)
inline

References m_pp, pp_string(), and text.

◆ add_utf8_byte()

void to_text::add_utf8_byte ( char b)
inline

References b, m_pp, and pp_character().

◆ colorize_text_ensure_normal()

void to_text::colorize_text_ensure_normal ( )
inline

References gcc_assert, and m_colorizer.

◆ colorize_text_for_cfg_edge()

void to_text::colorize_text_for_cfg_edge ( )
inline

References gcc_assert, and m_colorizer.

◆ colorize_text_for_fixit_delete()

void to_text::colorize_text_for_fixit_delete ( )
inline

References gcc_assert, and m_colorizer.

◆ colorize_text_for_fixit_insert()

void to_text::colorize_text_for_fixit_insert ( )
inline

References gcc_assert, and m_colorizer.

◆ colorize_text_for_range_idx()

void to_text::colorize_text_for_range_idx ( int range_idx)
inline

References gcc_assert, and m_colorizer.

◆ emit_text_prefix()

void to_text::emit_text_prefix ( )
inline

References m_pp, and pp_emit_prefix().

◆ invoke_start_span_fn()

void to_text::invoke_start_span_fn ( const diagnostic_source_print_policy & source_policy,
const diagnostic_location_print_policy & loc_policy,
const expanded_location & exploc )
inline

◆ is_html()

bool to_text::is_html ( )
inlinestatic

◆ is_text()

bool to_text::is_text ( )
inlinestatic

◆ pop_html_tag()

void to_text::pop_html_tag ( const char * )
inline

◆ print_decoded_char()

void to_text::print_decoded_char ( const char_display_policy & char_policy,
cpp_decoded_char cp )
inline

◆ push_html_tag()

void to_text::push_html_tag ( std::string ,
bool  )
inline

◆ push_html_tag_with_class()

void to_text::push_html_tag_with_class ( std::string ,
std::string ,
bool  )
inline

◆ layout_printer< to_text >

friend class layout_printer< to_text >
friend

Field Documentation

◆ m_colorizer

◆ m_pp

◆ m_saved_rule

diagnostic_prefixing_rule_t to_text::m_saved_rule
private

Referenced by to_text(), to_text(), and ~to_text().


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