Sort includes for files gdb/[a-f]*.[chyl].
[external/binutils.git] / gdb / cli-out.h
1 /* Output generating routines for GDB CLI.
2    Copyright (C) 1999-2019 Free Software Foundation, Inc.
3    Contributed by Cygnus Solutions.
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
9    the Free Software Foundation; either version 3 of the License, or
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
18    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
19
20 #ifndef CLI_OUT_H
21 #define CLI_OUT_H
22
23 #include <vector>
24
25 /* Local non-gdb includes.  */
26 #include "ui-out.h"
27
28 class cli_ui_out : public ui_out
29 {
30 public:
31
32   explicit cli_ui_out (ui_file *stream, ui_out_flags flags);
33   virtual ~cli_ui_out ();
34
35   ui_file *set_stream (ui_file *stream);
36
37 protected:
38
39   virtual void do_table_begin (int nbrofcols, int nr_rows,
40                                const char *tblid) override;
41   virtual void do_table_body () override;
42   virtual void do_table_end () override;
43   virtual void do_table_header (int width, ui_align align,
44                                 const std::string &col_name,
45                                 const std::string &col_hdr) override;
46   /* Note: level 0 is the top-level so LEVEL is always greater than
47      zero.  */
48   virtual void do_begin (ui_out_type type, const char *id) override;
49   virtual void do_end (ui_out_type type) override;
50   virtual void do_field_int (int fldno, int width, ui_align align,
51                              const char *fldname, int value) override;
52   virtual void do_field_skip (int fldno, int width, ui_align align,
53                               const char *fldname) override;
54   virtual void do_field_string (int fldno, int width, ui_align align,
55                                 const char *fldname,
56                                 const char *string,
57                                 ui_out_style_kind style) override;
58   virtual void do_field_fmt (int fldno, int width, ui_align align,
59                              const char *fldname, const char *format,
60                              va_list args)
61     override ATTRIBUTE_PRINTF (6,0);
62   virtual void do_spaces (int numspaces) override;
63   virtual void do_text (const char *string) override;
64   virtual void do_message (const char *format, va_list args) override
65     ATTRIBUTE_PRINTF (2,0);
66   virtual void do_wrap_hint (const char *identstring) override;
67   virtual void do_flush () override;
68   virtual void do_redirect (struct ui_file *outstream) override;
69
70   bool suppress_output ()
71   { return m_suppress_output; }
72
73 private:
74
75   void field_separator ();
76
77   std::vector<ui_file *> m_streams;
78   bool m_suppress_output;
79 };
80
81 extern cli_ui_out *cli_out_new (struct ui_file *stream);
82
83 extern void cli_display_match_list (char **matches, int len, int max);
84
85 #endif