GCC Middle and Back End API Reference
html_builder Class Reference
Collaboration diagram for html_builder:

Public Member Functions

 html_builder (diagnostic_context &context, pretty_printer &pp, const line_maps *line_maps, const html_generation_options &html_gen_opts)
void set_main_input_filename (const char *name)
void on_report_diagnostic (const diagnostic_info &diagnostic, diagnostic_t orig_diag_kind, diagnostic_html_format_buffer *buffer)
void emit_diagram (const diagnostic_diagram &diagram)
void end_group ()
std::unique_ptr< xml::elementtake_current_diagnostic ()
void flush_to_file (FILE *outf)
const xml::documentget_document () const
void set_printer (pretty_printer &pp)
std::unique_ptr< xml::elementmake_element_for_metadata (const diagnostic_metadata &metadata)
std::unique_ptr< xml::elementmake_element_for_patch (const diagnostic_info &diagnostic)
void add_focus_id (std::string focus_id)

Private Member Functions

void add_stylesheet (std::string url)
std::unique_ptr< xml::elementmake_element_for_diagnostic (const diagnostic_info &diagnostic, diagnostic_t orig_diag_kind, bool alert)
std::unique_ptr< xml::elementmake_metadata_element (label_text label, label_text url)
void add_at_nesting_level (size_t nesting_level, std::unique_ptr< xml::element > child_diag_element)
void push_nesting_level ()
void pop_nesting_level ()

Private Attributes

diagnostic_contextm_context
pretty_printerm_printer
const line_maps * m_line_maps
html_generation_options m_html_gen_opts
const logical_location_managerm_logical_loc_mgr
std::unique_ptr< xml::documentm_document
xml::elementm_head_element
xml::elementm_title_element
xml::elementm_diagnostics_element
std::unique_ptr< xml::elementm_cur_diagnostic_element
std::vector< xml::element * > m_cur_nesting_levels
int m_next_diag_id
json::array m_ui_focus_ids
logical_location m_last_logical_location
location_t m_last_location
expanded_location m_last_expanded_location

Friends

class diagnostic_html_format_buffer

Detailed Description

A class for managing HTML output of diagnostics. Implemented: - message text Known limitations/missing functionality: - title for page - file/line/column - error vs warning - CWEs - rules - fix-it hints - paths

Constructor & Destructor Documentation

◆ html_builder()

html_builder::html_builder ( diagnostic_context & context,
pretty_printer & pp,
const line_maps * line_maps,
const html_generation_options & html_gen_opts )

Member Function Documentation

◆ add_at_nesting_level()

◆ add_focus_id()

void html_builder::add_focus_id ( std::string focus_id)
inline

References m_ui_focus_ids.

Referenced by make_element_for_diagnostic().

◆ add_stylesheet()

void html_builder::add_stylesheet ( std::string url)
private

◆ emit_diagram()

void html_builder::emit_diagram ( const diagnostic_diagram & diagram)
Implementation of diagnostic_context::m_diagrams.m_emission_cb for HTML output.

References gcc_assert, and m_cur_diagnostic_element.

◆ end_group()

void html_builder::end_group ( )
Implementation of "end_group_cb" for HTML output.

References m_cur_diagnostic_element, and m_diagnostics_element.

◆ flush_to_file()

void html_builder::flush_to_file ( FILE * outf)
Create a top-level object, and add it to all the results (and other entities) we've seen so far. Flush it all to OUTF.

References xml::printer::add_raw(), gcc_assert, m_document, m_head_element, m_html_gen_opts, m_ui_focus_ids, xml::printer::pop_tag(), pp_formatted_text(), pp_string(), and xml::printer::push_tag().

◆ get_document()

const xml::document & html_builder::get_document ( ) const
inline

References m_document.

◆ make_element_for_diagnostic()

std::unique_ptr< xml::element > html_builder::make_element_for_diagnostic ( const diagnostic_info & diagnostic,
diagnostic_t orig_diag_kind,
bool alert )
private

◆ make_element_for_metadata()

◆ make_element_for_patch()

std::unique_ptr< xml::element > html_builder::make_element_for_patch ( const diagnostic_info & diagnostic)

◆ make_metadata_element()

std::unique_ptr< xml::element > html_builder::make_metadata_element ( label_text label,
label_text url )
private

◆ on_report_diagnostic()

void html_builder::on_report_diagnostic ( const diagnostic_info & diagnostic,
diagnostic_t orig_diag_kind,
diagnostic_html_format_buffer * buffer )

◆ pop_nesting_level()

void html_builder::pop_nesting_level ( )
private

◆ push_nesting_level()

void html_builder::push_nesting_level ( )
private

◆ set_main_input_filename()

void html_builder::set_main_input_filename ( const char * name)

References gcc_assert, and m_title_element.

◆ set_printer()

void html_builder::set_printer ( pretty_printer & pp)
inline

References m_printer.

◆ take_current_diagnostic()

std::unique_ptr< xml::element > html_builder::take_current_diagnostic ( )
inline

◆ diagnostic_html_format_buffer

Field Documentation

◆ m_context

◆ m_cur_diagnostic_element

std::unique_ptr<xml::element> html_builder::m_cur_diagnostic_element
private

◆ m_cur_nesting_levels

std::vector<xml::element *> html_builder::m_cur_nesting_levels
private

◆ m_diagnostics_element

xml::element* html_builder::m_diagnostics_element
private

Referenced by end_group(), and html_builder().

◆ m_document

std::unique_ptr<xml::document> html_builder::m_document
private

Referenced by flush_to_file(), and get_document().

◆ m_head_element

xml::element* html_builder::m_head_element
private

◆ m_html_gen_opts

html_generation_options html_builder::m_html_gen_opts
private

Referenced by flush_to_file(), and html_builder().

◆ m_last_expanded_location

expanded_location html_builder::m_last_expanded_location
private

◆ m_last_location

location_t html_builder::m_last_location
private

◆ m_last_logical_location

logical_location html_builder::m_last_logical_location
private

◆ m_line_maps

const line_maps* html_builder::m_line_maps
private

Referenced by html_builder().

◆ m_logical_loc_mgr

const logical_location_manager* html_builder::m_logical_loc_mgr
private

◆ m_next_diag_id

int html_builder::m_next_diag_id
private

◆ m_printer

pretty_printer* html_builder::m_printer
private

◆ m_title_element

xml::element* html_builder::m_title_element
private

◆ m_ui_focus_ids

json::array html_builder::m_ui_focus_ids
private

Referenced by add_focus_id(), and flush_to_file().


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