#include <cstring>
-#include <stdexcept>
+#include <msp/core/except.h>
#include "buffered.h"
#include "handle.h"
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));
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()
return do_write(&c, 1);
}
-bool Buffered::getline(std::string &line)
+bool Buffered::getline(string &line)
{
set_op(M_READ);
const Handle &Buffered::get_handle(Mode)
{
- throw logic_error("Buffered::get_handle");
+ throw unsupported("Buffered::get_handle");
}
void Buffered::set_op(Mode op)