aboutsummaryrefslogtreecommitdiff
path: root/gdb/ui-file.h
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2022-01-01 01:34:48 -0700
committerTom Tromey <tom@tromey.com>2022-03-29 12:46:24 -0600
commitc8d74a7b4b341f7498a3827555451924cabdd0f1 (patch)
tree549460704305e6e34c9ea3684a6729726102aac8 /gdb/ui-file.h
parent9b7167182d1f6fef32c264587bbc00c7f9bd21f2 (diff)
downloadfsf-binutils-gdb-c8d74a7b4b341f7498a3827555451924cabdd0f1.zip
fsf-binutils-gdb-c8d74a7b4b341f7498a3827555451924cabdd0f1.tar.gz
fsf-binutils-gdb-c8d74a7b4b341f7498a3827555451924cabdd0f1.tar.bz2
Add style-escape methods to ui_file
This adds emit_style_escape and reset_style methods to ui_file. These aren't used yet, but they will be once the pager is converted to be a ui_file subclass.
Diffstat (limited to 'gdb/ui-file.h')
-rw-r--r--gdb/ui-file.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/gdb/ui-file.h b/gdb/ui-file.h
index 7ae3937..1d946bf 100644
--- a/gdb/ui-file.h
+++ b/gdb/ui-file.h
@@ -124,6 +124,12 @@ public:
used to force out output from the wrap_buffer. */
void wrap_here (int indent);
+ /* 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 printf_filtered, but nothing else. */
@@ -132,6 +138,11 @@ public:
this->puts (str);
}
+protected:
+
+ /* The currently applied style. */
+ ui_file_style m_applied_style;
+
private:
/* Helper function for putstr and putstrn. Print the character C on
@@ -376,6 +387,14 @@ public:
sequences. */
void write (const char *buf, long length_buf) override;
void puts (const char *linebuffer) override;
+
+ void emit_style_escape (const ui_file_style &style) override
+ {
+ }
+
+ void reset_style () override
+ {
+ }
};
/* A ui_file that optionally puts a timestamp at the start of each