@@ -255,7 +255,7 @@ class CDataStream
255
255
void SetVersion (int n) { nVersion = n; }
256
256
int GetVersion () { return nVersion; }
257
257
258
- CDataStream& read (char * pch, size_t nSize)
258
+ void read (char * pch, size_t nSize)
259
259
{
260
260
// Read from the beginning of the buffer
261
261
unsigned int nReadPosNext = nReadPos + nSize;
@@ -268,14 +268,13 @@ class CDataStream
268
268
memcpy (pch, &vch[nReadPos], nSize);
269
269
nReadPos = 0 ;
270
270
vch.clear ();
271
- return (* this ) ;
271
+ return ;
272
272
}
273
273
memcpy (pch, &vch[nReadPos], nSize);
274
274
nReadPos = nReadPosNext;
275
- return (*this );
276
275
}
277
276
278
- CDataStream& ignore (int nSize)
277
+ void ignore (int nSize)
279
278
{
280
279
// Ignore from the beginning of the buffer
281
280
if (nSize < 0 ) {
@@ -288,17 +287,15 @@ class CDataStream
288
287
throw std::ios_base::failure (" CDataStream::ignore(): end of data" );
289
288
nReadPos = 0 ;
290
289
vch.clear ();
291
- return (* this ) ;
290
+ return ;
292
291
}
293
292
nReadPos = nReadPosNext;
294
- return (*this );
295
293
}
296
294
297
- CDataStream& write (const char * pch, size_t nSize)
295
+ void write (const char * pch, size_t nSize)
298
296
{
299
297
// Write to the end of the buffer
300
298
vch.insert (vch.end (), pch, pch + nSize);
301
- return (*this );
302
299
}
303
300
304
301
template <typename Stream>
@@ -433,16 +430,15 @@ class CAutoFile
433
430
void SetVersion (int n) { nVersion = n; }
434
431
int GetVersion () { return nVersion; }
435
432
436
- CAutoFile& read (char * pch, size_t nSize)
433
+ void read (char * pch, size_t nSize)
437
434
{
438
435
if (!file)
439
436
throw std::ios_base::failure (" CAutoFile::read: file handle is NULL" );
440
437
if (fread (pch, 1 , nSize, file) != nSize)
441
438
throw std::ios_base::failure (feof (file) ? " CAutoFile::read: end of file" : " CAutoFile::read: fread failed" );
442
- return (*this );
443
439
}
444
440
445
- CAutoFile& ignore (size_t nSize)
441
+ void ignore (size_t nSize)
446
442
{
447
443
if (!file)
448
444
throw std::ios_base::failure (" CAutoFile::ignore: file handle is NULL" );
@@ -453,16 +449,14 @@ class CAutoFile
453
449
throw std::ios_base::failure (feof (file) ? " CAutoFile::ignore: end of file" : " CAutoFile::read: fread failed" );
454
450
nSize -= nNow;
455
451
}
456
- return (*this );
457
452
}
458
453
459
- CAutoFile& write (const char * pch, size_t nSize)
454
+ void write (const char * pch, size_t nSize)
460
455
{
461
456
if (!file)
462
457
throw std::ios_base::failure (" CAutoFile::write: file handle is NULL" );
463
458
if (fwrite (pch, 1 , nSize, file) != nSize)
464
459
throw std::ios_base::failure (" CAutoFile::write: write failed" );
465
- return (*this );
466
460
}
467
461
468
462
template <typename T>
@@ -563,7 +557,7 @@ class CBufferedFile
563
557
}
564
558
565
559
// read a number of bytes
566
- CBufferedFile& read (char *pch, size_t nSize) {
560
+ void read (char *pch, size_t nSize) {
567
561
if (nSize + nReadPos > nReadLimit)
568
562
throw std::ios_base::failure (" Read attempted past buffer limit" );
569
563
if (nSize + nRewind > vchBuf.size ())
@@ -582,7 +576,6 @@ class CBufferedFile
582
576
pch += nNow;
583
577
nSize -= nNow;
584
578
}
585
- return (*this );
586
579
}
587
580
588
581
// return the current reading position
0 commit comments