Slide 5.19: TextBuffer.h
Slide 5.21: Read.h
Home

Constructor.h


The file Constructor.h includes two methods of the class TextBuffer: The new operator attempts to create an object of a string.

~wenchen/public_html/cgi-bin/351/week5/Constructor.h

TextBuffer::TextBuffer( int maxBytes1 ) {
  Init( maxBytes1 );
}

bool  TextBuffer::Init( int maxBytes1 ) {
  if ( maxBytes1 < 0 )  maxBytes1 = 0;
  maxBytes    = maxBytes1;
  nextByte    = 0;
  buffer      = new char[maxBytes];
  bufferSize  = 0;
  return( true );
}