Commit | Line | Data |
---|---|---|
8b93c638 | 1 | /* Output generating routines for GDB CLI. |
e2882c85 | 2 | Copyright (C) 1999-2018 Free Software Foundation, Inc. |
8b93c638 JM |
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 | |
a9762ec7 | 9 | the Free Software Foundation; either version 3 of the License, or |
8b93c638 JM |
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/>. */ |
8b93c638 JM |
19 | |
20 | #ifndef CLI_OUT_H | |
21 | #define CLI_OUT_H | |
22 | ||
0a8fce9a | 23 | #include "ui-out.h" |
b9b118c3 | 24 | #include <vector> |
0a8fce9a | 25 | |
112e8700 SM |
26 | class cli_ui_out : public ui_out |
27 | { | |
28 | public: | |
0a8fce9a | 29 | |
112e8700 SM |
30 | explicit cli_ui_out (ui_file *stream, ui_out_flags flags); |
31 | virtual ~cli_ui_out (); | |
0a8fce9a | 32 | |
112e8700 | 33 | ui_file *set_stream (ui_file *stream); |
0a8fce9a | 34 | |
112e8700 | 35 | protected: |
da3331ec | 36 | |
112e8700 | 37 | virtual void do_table_begin (int nbrofcols, int nr_rows, |
e427af18 | 38 | const char *tblid) override; |
112e8700 SM |
39 | virtual void do_table_body () override; |
40 | virtual void do_table_end () override; | |
41 | virtual void do_table_header (int width, ui_align align, | |
e427af18 TT |
42 | const std::string &col_name, |
43 | const std::string &col_hdr) override; | |
112e8700 SM |
44 | /* Note: level 0 is the top-level so LEVEL is always greater than |
45 | zero. */ | |
46 | virtual void do_begin (ui_out_type type, const char *id) override; | |
47 | virtual void do_end (ui_out_type type) override; | |
48 | virtual void do_field_int (int fldno, int width, ui_align align, | |
e427af18 | 49 | const char *fldname, int value) override; |
112e8700 | 50 | virtual void do_field_skip (int fldno, int width, ui_align align, |
e427af18 | 51 | const char *fldname) override; |
112e8700 | 52 | virtual void do_field_string (int fldno, int width, ui_align align, |
e427af18 TT |
53 | const char *fldname, |
54 | const char *string) override; | |
112e8700 | 55 | virtual void do_field_fmt (int fldno, int width, ui_align align, |
e427af18 TT |
56 | const char *fldname, const char *format, |
57 | va_list args) | |
112e8700 SM |
58 | override ATTRIBUTE_PRINTF (6,0); |
59 | virtual void do_spaces (int numspaces) override; | |
60 | virtual void do_text (const char *string) override; | |
61 | virtual void do_message (const char *format, va_list args) override | |
62 | ATTRIBUTE_PRINTF (2,0); | |
63 | virtual void do_wrap_hint (const char *identstring) override; | |
64 | virtual void do_flush () override; | |
7becfd03 | 65 | virtual void do_redirect (struct ui_file *outstream) override; |
8b93c638 | 66 | |
112e8700 SM |
67 | bool suppress_output () |
68 | { return m_suppress_output; } | |
0a8fce9a | 69 | |
112e8700 SM |
70 | private: |
71 | ||
72 | void field_separator (); | |
112e8700 SM |
73 | |
74 | std::vector<ui_file *> m_streams; | |
75 | bool m_suppress_output; | |
76 | }; | |
77 | ||
78 | extern cli_ui_out *cli_out_new (struct ui_file *stream); | |
4389a95a | 79 | |
82083d6d DE |
80 | extern void cli_display_match_list (char **matches, int len, int max); |
81 | ||
8b93c638 | 82 | #endif |