1 #ifndef MSP_IO_CONSOLE_H_
2 #define MSP_IO_CONSOLE_H_
4 #include "eventobject.h"
11 Provides access to standard input, output and error streams. This class can't
12 be instantiated directly - use one of the cin, cout and cerr references
15 class Console: public EventObject
34 virtual void set_block(bool);
36 /** If local echo is enabled, characters will appear on the console as they
37 are typed. Can only be used on an input Console. */
38 void set_local_echo(bool);
40 /** If line buffering is enabled, input will only be available when a
41 newline is encountered. On some systems, this may also enable line editing.
42 Can only be used on an input Console.
44 void set_line_buffer(bool);
46 /** Retrieves the size of the Console. Can only be used on an output
48 void get_size(unsigned &rows, unsigned &cols);
50 /** Redirects input from or output to another I/O object. This performs a
51 system-level redirect. Closing the other object won't affect the
53 void redirect(Base &);
56 virtual unsigned do_write(const char *, unsigned);
57 virtual unsigned do_read(char *, unsigned);
60 virtual const Handle &get_event_handle() { return handle; }
62 static Console &instance(Stream);