DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
iostream examples

setbuf

The virtual function setbuf is called by user code to offer an array for use as a holding area. It can also be used to turn off buffering.

   streambuf* fctbuf::setbuf(char* b, int len)
   {
   	if ( base() ) return 0 ;
   	
   	if ( b!=0 && len > sizeof(small) ) {
   		// set up holding area
   		setb(b,b+len) ;
   		}
   	else {
   		// Use a one character array to achieve
   		// "unbuffered" actions.
   		setb(small,small+sizeof(small)) ;
   		}
   	setp(0,0) ; 		// put area
   	setg(0,0,0) ;		// get area
   	return this ;
   	}


The actions of this function are:
Next topic: overflow
Previous topic: Deriving new streambuf classes

© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 -- 02 June 2005