]> git.tdb.fi Git - libs/core.git/blobdiff - source/io/base.cpp
Add functions to support console redirection
[libs/core.git] / source / io / base.cpp
index 926440a9c4575da477b37e4ad60eea3593ef86a4..052d464becb6f793cb774c32e38c4fa40e686721 100644 (file)
@@ -16,6 +16,12 @@ Base::~Base()
        signal_deleted.emit();
 }
 
+void Base::check_access(Mode m) const
+{
+       if(!(mode&m))
+               throw invalid_access(m);
+}
+
 bool Base::getline(string &line)
 {
        line.clear();
@@ -42,5 +48,19 @@ int Base::get()
        return static_cast<unsigned char>(c);
 }
 
+void Base::set_eof()
+{
+       if(!eof_flag)
+       {
+               eof_flag = true;
+               signal_end_of_file.emit();
+       }
+}
+
+const Handle &Base::get_handle(Mode)
+{
+       throw logic_error("Base::get_handle");
+}
+
 } // namespace IO
 } // namespace Msp