X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fio%2Fbuffered.cpp;h=9f001fbe9ae94b944611f368416799ceab836a04;hb=39da82b967c70282973025e4b12186625e29fe26;hp=55c69a635cf69d0a6b8f41b0f2eec67a028b16e7;hpb=c8bf2d6c15893ccc9dbc4e04611b7229029f4808;p=libs%2Fcore.git diff --git a/source/io/buffered.cpp b/source/io/buffered.cpp index 55c69a6..9f001fb 100644 --- a/source/io/buffered.cpp +++ b/source/io/buffered.cpp @@ -1,5 +1,5 @@ #include -#include +#include #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)