Path readlink(const Path &link)
{
(void)link;
- throw unsupported("no symbolic links on win32");
+ throw unsupported("readlink");
}
Path realpath(const Path &path)
#ifdef _WIN32
if(objects.size()>=MAXIMUM_WAIT_OBJECTS)
- throw invalid_state("Maximum number of wait objects reached");
+ throw invalid_state("too many objects");
#endif
objects.push_back(PolledObject(&obj, ev));
PollEvent poll(EventObject &obj, PollEvent pe, const Time::TimeDelta &timeout)
{
if(timeout<Time::zero)
- throw invalid_argument("poll");
+ throw invalid_argument("IO::poll");
return platform_poll(obj, pe, static_cast<int>(timeout/Time::msec));
}
length(l)
{
if(s<0 || l<0)
- throw invalid_argument("Slice");
+ throw invalid_argument("Slice::Slice");
Base::Synchronize sync(below);
mode = below.get_mode()&M_RDWR;
else if(st==S_END)
return SEEK_END;
- throw invalid_argument("sys_seek_type");
+ throw invalid_argument("IO::sys_seek");
}
}
case 3000000: speed = 0010015; break;
case 3500000: speed = 0010016; break;
case 4000000: speed = 0010017; break;
- default: throw invalid_argument("set_baud_rate");
+ default: throw invalid_argument("Serial::set_baud_rate");
}
int ret = cfsetospeed(&state, speed);
if(ret==0)
ret = cfsetispeed(&state, speed);
if(ret<0)
- throw invalid_argument("set_baud_rate");
+ throw invalid_argument("Serial::set_baud_rate");
}
void Serial::DeviceState::set_data_bits(unsigned bits)
case 6: flag = CS6; break;
case 7: flag = CS7; break;
case 8: flag = CS8; break;
- default: throw invalid_argument("set_data_bits");
+ default: throw invalid_argument("Serial::set_data_bits");
}
state.c_cflag = (state.c_cflag&~CSIZE)|flag;
case Serial::NONE: flag = 0; break;
case Serial::EVEN: flag = PARENB; break;
case Serial::ODD: flag = PARENB|PARODD; break;
- default: throw invalid_argument("set_parity");
+ default: throw invalid_argument("Serial::set_parity");
}
state.c_cflag = (state.c_cflag&~(PARENB|PARODD))|flag;
{
case 1: flag = 0; break;
case 2: flag = CSTOPB; break;
- default: throw invalid_argument("set_stop_bits");
+ default: throw invalid_argument("Serial::set_stop_bits");
}
state.c_cflag = (state.c_cflag&~CSTOPB)|flag;
size_t sys_read(Handle &handle, char *buf, size_t size)
{
if(size>numeric_limits<DWORD>::max())
- throw invalid_argument("read");
+ throw invalid_argument("IO::sys_read");
DWORD ret;
if(ReadFile(*handle, buf, size, &ret, nullptr)==0)
size_t sys_write(Handle &handle, const char *buf, size_t size)
{
if(size>numeric_limits<DWORD>::max())
- throw invalid_argument("write");
+ throw invalid_argument("IO::sys_write");
DWORD ret;
if(WriteFile(*handle, buf, size, &ret, nullptr)==0)
else if(st==S_END)
return FILE_END;
- throw invalid_argument("sys_seek_type");
+ throw invalid_argument("IO::sys_seek");
}
}
case Serial::NONE: state.Parity = NOPARITY; break;
case Serial::EVEN: state.Parity = EVENPARITY; break;
case Serial::ODD: state.Parity = ODDPARITY; break;
- default: throw invalid_argument("set_parity");
+ default: throw invalid_argument("Serial::set_parity");
}
}
{
case 1: state.StopBits = ONESTOPBIT; break;
case 2: state.StopBits = TWOSTOPBITS; break;
- default: throw invalid_argument("set_stop_bits");
+ default: throw invalid_argument("Serial::set_stop_bits");
}
}
else if(em_str=="trans" || em_str=="transliterate")
em = TRANSLITERATE;
else
- throw invalid_argument("invalid error mode");
+ throw invalid_argument("StringCodec::create_codec");
}
if(name=="ascii") return new Ascii(em);
if(name=="utf16be") return new Utf16(em, Utf16::BIG);
if(name=="utf16le") return new Utf16(em, Utf16::LITTLE);
if(name=="windows1252" || name=="cp1252") return new Windows1252(em);
- throw invalid_argument("unknown string codec");
+ throw invalid_argument("StringCodec::create_codec");
}
Codec *detect_codec(const string &str)