示例#1
0
文件: istream.cpp 项目: FlowSea/acl
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;
}
示例#2
0
文件: istream.cpp 项目: FlowSea/acl
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;
}