From: Mikko L. <laz...@us...> - 2004-06-13 07:52:05
|
Update of /cvsroot/rtk/rtk/src/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8391 Modified Files: Buffer.cpp Log Message: changed From func a bit Index: Buffer.cpp =================================================================== RCS file: /cvsroot/rtk/rtk/src/core/Buffer.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Buffer.cpp 12 Jun 2004 22:48:29 -0000 1.8 --- Buffer.cpp 13 Jun 2004 07:51:56 -0000 1.9 *************** *** 106,117 **** void Buffer::From(IO* arg_io) { ! if(!arg_io->CanRead()) return; // Some error checks should be here... ! arg_io->Seek(0, IO::END); ! long size = arg_io->Tell(); ! arg_io->Seek(0, IO::BEGIN); ! Allocate(size+1); ! _data[size] = '\0'; ! _size = arg_io->Read(_data, size); } // From() --- 106,117 ---- void Buffer::From(IO* arg_io) { ! if(!arg_io->CanRead() && arg_io->IsOpen()) return; // Some error checks should be here... ! while(!arg_io->IsEos()) ! { ! uchar buf[1024]; ! int bytes = arg_io->Read(buf, sizeof(buf)); ! this->Write(buf, bytes); ! } } // From() *************** *** 119,123 **** { if (!_size) return; ! if (arg_io->CanWrite()) { arg_io->Write(_data, _size); --- 119,123 ---- { if (!_size) return; ! if (arg_io->CanWrite() && arg_io->IsOpen()) { arg_io->Write(_data, _size); |