]> git.tdb.fi Git - libs/core.git/blobdiff - source/io/buffered.cpp
Add move semantics to Variant
[libs/core.git] / source / io / buffered.cpp
index 55c69a635cf69d0a6b8f41b0f2eec67a028b16e7..9f001fbe9ae94b944611f368416799ceab836a04 100644 (file)
@@ -1,5 +1,5 @@
 #include <cstring>
-#include <stdexcept>
+#include <msp/core/except.h>
 #include "buffered.h"
 #include "handle.h"
 
@@ -13,8 +13,7 @@ Buffered::Buffered(Base &b, unsigned s):
        buf_size(s),
        buf(new char[buf_size]),
        begin(buf),
-       end(buf),
-       cur_op(M_NONE)
+       end(buf)
 {
        mode = below.get_mode();
        below.signal_flush_required.connect(sigc::mem_fun(this, &Buffered::flush));
@@ -34,12 +33,12 @@ Buffered::~Buffered()
 
 void Buffered::set_block(bool)
 {
-       throw logic_error("Buffered::set_block");
+       throw unsupported("Buffered::set_block");
 }
 
 void Buffered::set_inherit(bool)
 {
-       throw logic_error("Buffered::set_block");
+       throw unsupported("Buffered::set_block");
 }
 
 void Buffered::flush()
@@ -150,7 +149,7 @@ size_t Buffered::put(char c)
                return do_write(&c, 1);
 }
 
-bool Buffered::getline(std::string &line)
+bool Buffered::getline(string &line)
 {
        set_op(M_READ);
 
@@ -180,7 +179,7 @@ int Buffered::get()
 
 const Handle &Buffered::get_handle(Mode)
 {
-       throw logic_error("Buffered::get_handle");
+       throw unsupported("Buffered::get_handle");
 }
 
 void Buffered::set_op(Mode op)