home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c082_122 / 9.ddi / IOSTRSR1.ZIP / STBSGETN.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1992-06-10  |  1.1 KB  |  38 lines

  1. /*[]------------------------------------------------------------[]*/
  2. /*|                                                              |*/
  3. /*|     stbsgetn.cpp                                             |*/
  4. /*|                                                              |*/
  5. /*|     Class streambuf                                          |*/
  6. /*|          int streambuf::sgetn( char *, int )                 |*/
  7. /*|                                                              |*/
  8. /*[]------------------------------------------------------------[]*/
  9.  
  10. /*
  11.  *      C/C++ Run Time Library - Version 5.0
  12.  *
  13.  *      Copyright (c) 1990, 1992 by Borland International
  14.  *      All Rights Reserved.
  15.  *
  16.  */
  17.  
  18. #include <ioconfig.h>
  19. #include <iostream.h>
  20.  
  21. /*
  22.  * The following functions are expected to be inline, but just in case
  23.  * they aren't, and they generate a LOT of code, here they are as
  24.  * global closed subroutines.
  25.  */
  26.  
  27. int streambuf::sgetn(char* s, int n)
  28. {
  29.     if( n <= (egptr_ - gptr_) )
  30.         {
  31.         memcpy(s, gptr_, n);
  32.         gbump(n);
  33.         return n;
  34.         }
  35.     return do_sgetn(s, n);
  36. }
  37.  
  38.