1 /* MI Command Set - MI Console.
2 Copyright (C) 2000-2017 Free Software Foundation, Inc.
3 Contributed by Cygnus Solutions (a Red Hat company).
5 This file is part of GDB.
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.
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.
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/>. */
23 /* An output stream for MI. Wraps a given output stream with a prefix
24 and handles quoting. This stream is locally buffered. */
26 class mi_console_file : public ui_file
29 /* Create a console that wraps the given output stream RAW with the
30 string PREFIX and quoting it with QUOTE. */
31 mi_console_file (ui_file *raw, const char *prefix, char quote);
33 /* MI-specific API. */
34 void set_raw (ui_file *raw);
36 /* ui_file-specific methods. */
38 void flush () override;
40 void write (const char *buf, long length_buf) override;
43 /* The wrapped raw output stream. */
46 /* The local buffer. */