Write the specified comment into the specified stream.

Synopsis

Declared in <balxml_formatter_compactimpl.h>

static
std::ostream&
addComment(
    std::ostream& stream,
    State* state,
    std::string_view const& comment,
    bool forceNewline = true);

Description

Formatting depends on the specified state, and the state is updated accordingly. Return the stream. The optionally specified forceNewline, if true, forces to start a new line solely for the comment if it's not on a new line already. Otherwise, comments continue on current line. If an element‐opening tag is not completed with a >, addComment will add >.

DEPRECATED: Use addValidComment instead.

Return Value

a reference to the modifiable stream

Parameters

Name

Description

stream

output stream

state

formatter state to consult and update

comment

comment text to write

forceNewline

if true, start the comment on a new line

Created with MrDocs