Add get_handle to Console
authorMikko Rasa <tdb@tdb.fi>
Mon, 14 Oct 2013 19:19:16 +0000 (22:19 +0300)
committerMikko Rasa <tdb@tdb.fi>
Mon, 14 Oct 2013 19:19:16 +0000 (22:19 +0300)
This is needed to e.g. redirect cerr to cout.

source/io/console.cpp
source/io/console.h

index d50d72df89a5b8b3e353e5612feb8175703f4a93..aee02e262d08609964c8b818b5a49ae7996b8661 100644 (file)
@@ -39,6 +39,12 @@ unsigned Console::do_read(char *buf, unsigned len)
        return ret;
 }
 
+const Handle &Console::get_handle(Mode m)
+{
+       check_access(m);
+       return handle;
+}
+
 Console &Console::instance(Stream s)
 {
        static Console in(CIN);
index 5cb5f178e07f4279a465629dde4219ce514c833b..e2b5d533cc0f1ac6d45749fbbbde7f9b712b5688 100644 (file)
@@ -57,6 +57,7 @@ protected:
        virtual unsigned do_read(char *, unsigned);
 
 public:
+       virtual const Handle &get_handle(Mode);
        virtual const Handle &get_event_handle() { return handle; }
 
        static Console &instance(Stream);