]> git.tdb.fi Git - libs/core.git/blobdiff - source/io/console.h
Use vectors for storage in Poller
[libs/core.git] / source / io / console.h
index 6d6c788780f70887de6d0571cb15ece611dfaf0f..8feccfd2ffe74a2fd3e1e05d69310e887eb7c0d6 100644 (file)
@@ -14,14 +14,25 @@ instead.
 */
 class Console: public EventObject
 {
+public:
+       enum Stream
+       {
+               CIN = 0,
+               COUT = 1,
+               CERR = 2
+       };
+
 private:
+       Stream stream;
        Handle handle;
 
-       Console(unsigned);
+       Console(Stream);
+       void platform_init();
 public:
        ~Console();
 
        virtual void set_block(bool);
+       virtual void set_inherit(bool);
        
        /** If local echo is enabled, characters will appear on the console as they
        are typed.  Can only be used on an input Console.  */
@@ -37,14 +48,20 @@ public:
        Console. */
        void get_size(unsigned &rows, unsigned &cols);
 
+       /** Redirects input from or output to another I/O object.  This performs a
+       system-level redirect.  Closing the other object won't affect the
+       redirection. */
+       void redirect(Base &);
+
 protected:
        virtual unsigned do_write(const char *, unsigned);
        virtual unsigned do_read(char *, unsigned);
 
 public:
+       virtual const Handle &get_handle(Mode);
        virtual const Handle &get_event_handle() { return handle; }
 
-       static Console &instance(unsigned);
+       static Console &instance(Stream);
 };
 
 extern Console &cin;