gdb_printf ("%c", c);
}
- gdb_stdout->reset_style ();
+ gdb_stdout->emit_style_escape (ui_file_style ());
/* Force this output to appear now. */
gdb_flush (gdb_stdout);
}
void emit_style_escape (const ui_file_style &style) override;
- void reset_style () override;
void flush () override;
printf_command (const char *arg, int from_tty)
{
ui_printf (arg, gdb_stdout);
- gdb_stdout->reset_style ();
+ gdb_stdout->emit_style_escape (ui_file_style ());
gdb_stdout->wrap_here (0);
gdb_stdout->flush ();
}
/* See ui-file.h. */
-void
-ui_file::reset_style ()
-{
- if (can_emit_style_escape ())
- {
- m_applied_style = ui_file_style ();
- this->puts (m_applied_style.to_ansi ().c_str ());
- }
-}
-
-/* See ui-file.h. */
-
void
ui_file::printchar (int c, int quoter, bool async_safe)
{
/* Emit an ANSI style escape for STYLE. */
virtual void emit_style_escape (const ui_file_style &style);
- /* Rest the current output style to the empty style. */
- virtual void reset_style ();
-
/* Print STR, bypassing any paging that might be done by this
ui_file. Note that nearly no code should call this -- it's
intended for use by gdb_printf, but nothing else. */
m_two->emit_style_escape (style);
}
- void reset_style () override
- {
- m_one->reset_style ();
- m_two->reset_style ();
- }
-
void puts_unfiltered (const char *str) override
{
m_one->puts_unfiltered (str);
void emit_style_escape (const ui_file_style &style) override
{
}
-
- void reset_style () override
- {
- }
};
/* A base class for ui_file types that wrap another ui_file. */
void emit_style_escape (const ui_file_style &style) override
{ m_stream->emit_style_escape (style); }
- /* Rest the current output style to the empty style. */
- void reset_style () override
- { m_stream->reset_style (); }
-
int fd () const override
{ return m_stream->fd (); }
}
}
-/* See pager.h. */
-
-void
-pager_file::reset_style ()
-{
- if (can_emit_style_escape ())
- {
- m_applied_style = ui_file_style ();
- m_wrap_buffer.append (m_applied_style.to_ansi ());
- }
-}
-
/* Wait, so the user can read what's on the screen. Prompt the user
to continue by pressing RETURN. 'q' is also provided because
telling users what to do in the prompt is more user-friendly than