Example #1
0
bool istream::read_peek(string& buf, bool clear /* = false */)
{
	if (clear)
		buf.clear();

	if (acl_vstream_read_peek(stream_, buf.vstring()) == ACL_VSTREAM_EOF)
	{
		eof_ = true;
		return false;
	}
	else
		return true;
}
Example #2
0
bool istream::read_peek(string& buf, bool clear /* = false */)
{
    if (clear)
        buf.clear();

    if (acl_vstream_read_peek(stream_, buf.vstring()) == ACL_VSTREAM_EOF)
    {
#if ACL_EWOULDBLOCK == ACL_EAGAIN
        if (stream_->errnum != ACL_EWOULDBLOCK)
#else
        if (stream_->errnum != ACL_EWOULDBLOCK
                && stream_->errnum != ACL_EAGAIN)
#endif
        {
            eof_ = true;
        }
        return false;
    }
    else
        return true;
}