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

© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 27 April 2004