Automatic Copyright Year update after running gdb/copyright.py
[deliverable/binutils-gdb.git] / gdb / mi / mi-out.h
CommitLineData
fb40c209 1/* MI Command Set - MI output generating routines for GDB.
88b9d363 2 Copyright (C) 2000-2022 Free Software Foundation, Inc.
ab91fdd5 3 Contributed by Cygnus Solutions (a Red Hat company).
fb40c209
AC
4
5 This file is part of GDB.
6
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
a9762ec7 9 the Free Software Foundation; either version 3 of the License, or
fb40c209
AC
10 (at your option) any later version.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
a9762ec7 18 along with this program. If not, see <http://www.gnu.org/licenses/>. */
fb40c209 19
1a5c2598
TT
20#ifndef MI_MI_OUT_H
21#define MI_MI_OUT_H
fb40c209 22
112e8700
SM
23#include <vector>
24
fb40c209
AC
25struct ui_out;
26struct ui_file;
fb40c209 27
fb40c209 28
112e8700
SM
29class mi_ui_out : public ui_out
30{
31public:
32
d7e74731 33 explicit mi_ui_out (int mi_version);
112e8700
SM
34 virtual ~mi_ui_out ();
35
36 /* MI-specific */
37 void rewind ();
38 void put (struct ui_file *stream);
39
40 /* Return the version number of the current MI. */
41 int version ();
42
046bebe1
TT
43 bool can_emit_style_escape () const override
44 {
45 return false;
46 }
47
112e8700
SM
48protected:
49
50 virtual void do_table_begin (int nbrofcols, int nr_rows, const char *tblid)
51 override;
52 virtual void do_table_body () override;
53 virtual void do_table_header (int width, ui_align align,
54 const std::string &col_name,
55 const std::string &col_hdr) override;
56 virtual void do_table_end () override;
57
58 virtual void do_begin (ui_out_type type, const char *id) override;
59 virtual void do_end (ui_out_type type) override;
381befee
TT
60 virtual void do_field_signed (int fldno, int width, ui_align align,
61 const char *fldname, LONGEST value) override;
1f77b012
TT
62 virtual void do_field_unsigned (int fldno, int width, ui_align align,
63 const char *fldname, ULONGEST value)
64 override;
112e8700
SM
65 virtual void do_field_skip (int fldno, int width, ui_align align,
66 const char *fldname) override;
67 virtual void do_field_string (int fldno, int width, ui_align align,
cbe56571 68 const char *fldname, const char *string,
e43b10e1 69 const ui_file_style &style) override;
112e8700 70 virtual void do_field_fmt (int fldno, int width, ui_align align,
7f6aba03
TT
71 const char *fldname, const ui_file_style &style,
72 const char *format, va_list args)
73 override ATTRIBUTE_PRINTF (7,0);
112e8700
SM
74 virtual void do_spaces (int numspaces) override;
75 virtual void do_text (const char *string) override;
2a3c1174
PA
76 virtual void do_message (const ui_file_style &style,
77 const char *format, va_list args) override
78 ATTRIBUTE_PRINTF (3,0);
112e8700
SM
79 virtual void do_wrap_hint (const char *identstring) override;
80 virtual void do_flush () override;
7becfd03 81 virtual void do_redirect (struct ui_file *outstream) override;
112e8700 82
4904c3c6 83 virtual bool do_is_mi_like_p () const override
112e8700
SM
84 { return true; }
85
2f228731
TT
86 virtual void do_progress_start (const std::string &, bool) override
87 {
88 }
89
90 virtual void do_progress_notify (double) override
91 {
92 }
93
94 virtual void do_progress_end () override
95 {
96 }
97
112e8700
SM
98private:
99
100 void field_separator ();
101 void open (const char *name, ui_out_type type);
102 void close (ui_out_type type);
103
d7e74731
PA
104 /* Convenience method that returns the MI out's string stream cast
105 to its appropriate type. Assumes/asserts that output was not
106 redirected. */
107 string_file *main_stream ();
108
112e8700
SM
109 bool m_suppress_field_separator;
110 bool m_suppress_output;
111 int m_mi_version;
112 std::vector<ui_file *> m_streams;
113};
114
8e5e5494
SM
115/* Create an MI ui-out object with MI version MI_VERSION, which should be equal
116 to one of the INTERP_MI* constants (see interps.h).
117
118 Return nullptr if an invalid version is provided. */
119mi_ui_out *mi_out_new (const char *mi_version);
120
112e8700
SM
121int mi_version (ui_out *uiout);
122void mi_out_put (ui_out *uiout, struct ui_file *stream);
123void mi_out_rewind (ui_out *uiout);
c7ec4050 124
1a5c2598 125#endif /* MI_MI_OUT_H */
This page took 2.14327 seconds and 4 git commands to generate.