Example #1
0
bool istream::read(string& s, size_t max, bool loop /* = true */)
{
	s.clear();
	s.space(max);
	int ret = read(s.buf(), max, loop);
	if (ret == -1)
		return false;
	s.set_offset(ret);
	return true;
}
Example #2
0
bool istream::read(string& s, bool loop /* = true */)
{
	s.clear();
	int   ret;

	if ((ret = read(s.buf(), s.capacity(), loop)) == -1)
		return false;
	s.set_offset(ret);
	return true;
}