コード例 #1
0
ファイル: ssfoverf.cpp プロジェクト: ABratovic/open-watcom-v2
  int strstreambuf::overflow( int c ) {
    __lock_it( __b_lock );
    if( !__dynamic ) {
        return( EOF );
    }
    if( __unlimited ) {
        // adjust end pointer
        int offset = out_waiting();
        setp( pbase(), epptr() + DEFAULT_MAINBUF_SIZE );
        pbump( offset );
        return( __NOT_EOF );
    }

    // Use doallocate() because streambuf::allocate() will not grow an
    // existing buffer the way strstreambuf needs to
    if( doallocate() == EOF ) {
        return( EOF );
    }
    if( c != EOF ) {
        *pptr() = (char)c;
        pbump( 1 );
    }
    return( __NOT_EOF );
  }
コード例 #2
0
ファイル: p811.C プロジェクト: 5432935/crossbridge
    int allocate() {
	if (base() || unbuffered()) return 0;
	else return doallocate(); }
コード例 #3
0
void streambuf::doallocbuf()
{
    if (base() || (!unbuffered() && doallocate() != EOF)) return;
    setb(_shortbuf, _shortbuf+1, 0);
}