Changed readFrom, which is no longer line based

This commit is contained in:
mac 2000-03-22 15:39:32 +00:00
commit 7fe8f333e7

View file

@ -110,25 +110,19 @@ class eoPop: public vector<EOT>, public eoObject, public eoPersistent {
* @param _is A istream. * @param _is A istream.
*/ */
virtual void readFrom(istream& _is) { virtual void readFrom(istream& _is)
while( _is ) { // reads line by line, and creates an object per {
// line while( _is )
char line[MAXLINELENGTH]; {
_is.getline( line, MAXLINELENGTH-1 ); EOT thisEOT;
if (strlen( line ) ) { thisEOT.readFrom( _is );
istrstream s( line );
EOT thisEOT;
thisEOT.readFrom( s );
push_back( thisEOT ); push_back( thisEOT );
}
} }
} }
/** /**
* Write object. It's called printOn since it prints the object _on_ a stream. * Write object. It's called printOn since it prints the object _on_ a stream.
* @param _os A ostream. In this case, prints the population to * @param _os A ostream.
standard output. The EOT class must hav standard output with cout,
but since it should be an eoObject anyways, it's no big deal.
*/ */
virtual void printOn(ostream& _os) const { virtual void printOn(ostream& _os) const {
copy( begin(), end(), ostream_iterator<EOT>( _os, "\n") ); copy( begin(), end(), ostream_iterator<EOT>( _os, "\n") );