home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c221 / 6.ddi / MWHC.006 / J0 < prev    next >
Encoding:
Text File  |  1992-06-07  |  4.2 KB  |  132 lines

  1. #ifndef __RWBSTREAM_H__
  2. #define __RWBSTREAM_H__
  3. pragma push_align_members(64);
  4.  
  5. /*
  6.  * rwb[io]stream ---    Use Binary reads and writes
  7.  *
  8.  * $Header:   E:/vcs/rw/bstream.h_v   1.6   18 Feb 1992 09:54:08   KEFFER  $
  9.  *
  10.  ****************************************************************************
  11.  *
  12.  * Rogue Wave 
  13.  * P.O. Box 2328
  14.  * Corvallis, OR 97339
  15.  * Voice: (503) 754-3010    FAX: (503) 757-6650
  16.  *
  17.  * Copyright (C) 1989, 1990, 1991. This software is subject to copyright 
  18.  * protection under the laws of the United States and other countries.
  19.  *
  20.  ***************************************************************************
  21.  *
  22.  * $Log:   E:/vcs/rw/bstream.h_v  $
  23.  * 
  24.  *    Rev 1.6   18 Feb 1992 09:54:08   KEFFER
  25.  * 
  26.  *    Rev 1.5   05 Nov 1991 13:51:40   keffer
  27.  * Can now live in the DLL.
  28.  * 
  29.  *    Rev 1.4   17 Oct 1991 09:12:40   keffer
  30.  * Changed include path to <rw/xxx.h>
  31.  * 
  32.  *    Rev 1.2   29 Jul 1991 11:33:32   keffer
  33.  * Macro CHAR_MATCHES_UCHAR checks for overloaded unsigned char
  34.  * 
  35.  *    Rev 1.1   24 Jul 1991 13:06:40   keffer
  36.  * Added pvcs keywords
  37.  *
  38.  */
  39.  
  40. #include "rw/vstream.h"
  41.  
  42. /************************************************
  43.  *                        *
  44.  *        class RWbistream        *
  45.  *                        *
  46.  ************************************************/
  47.  
  48. class RWExport RWbistream : public RWvistream {
  49. public:
  50.  
  51.   RWbistream(istream& str);
  52.   RWbistream(streambuf* s);
  53.  
  54.   virtual int        get();
  55.   virtual RWvistream&    get(char&);
  56. #ifndef CHAR_MATCHES_UCHAR
  57.   virtual RWvistream&    get(unsigned char&);
  58. #endif
  59.   virtual RWvistream&    get(char*, unsigned N);
  60.   virtual RWvistream&    get(double*, unsigned N);
  61.   virtual RWvistream&    get(float*, unsigned N);
  62.   virtual RWvistream&    get(int*, unsigned N);
  63.   virtual RWvistream&    get(long*, unsigned N);
  64.   virtual RWvistream&    get(short*, unsigned N);
  65. #ifndef CHAR_MATCHES_UCHAR
  66.   virtual RWvistream&    get(unsigned char*, unsigned N);
  67. #endif
  68.   virtual RWvistream&    get(unsigned short*, unsigned N);
  69.   virtual RWvistream&    get(unsigned int*, unsigned N);
  70.   virtual RWvistream&    get(unsigned long*, unsigned N);
  71.   virtual RWvistream&    getString(char* s, unsigned maxlen);
  72.   virtual RWvistream&    operator>>(char&);
  73.   virtual RWvistream&    operator>>(double&);
  74.   virtual RWvistream&    operator>>(float&);
  75.   virtual RWvistream&    operator>>(int&);
  76.   virtual RWvistream&    operator>>(long&);
  77.   virtual RWvistream&    operator>>(short&);
  78. #ifndef CHAR_MATCHES_UCHAR
  79.   virtual RWvistream&    operator>>(unsigned char&);
  80. #endif
  81.   virtual RWvistream&    operator>>(unsigned int&);
  82.   virtual RWvistream&    operator>>(unsigned long&);
  83.   virtual RWvistream&    operator>>(unsigned short&);
  84. protected:
  85.   void near        checkRead() const;
  86. };
  87.  
  88. /************************************************
  89.  *                        *
  90.  *        class RWbostream        *
  91.  *                        *
  92.  ************************************************/
  93.  
  94. class RWExport RWbostream : public RWvostream {
  95. public:
  96.  
  97.   RWbostream(ostream& str);
  98.   RWbostream(streambuf* s);
  99.  
  100.   virtual RWvostream&    operator<<(const char*);
  101.   virtual RWvostream&    operator<<(char);
  102. #ifndef CHAR_MATCHES_UCHAR
  103.   virtual RWvostream&    operator<<(unsigned char);
  104. #endif
  105.   virtual RWvostream&    operator<<(double);
  106.   virtual RWvostream&    operator<<(float);
  107.   virtual RWvostream&    operator<<(int);
  108.   virtual RWvostream&    operator<<(unsigned int);
  109.   virtual RWvostream&    operator<<(long);
  110.   virtual RWvostream&    operator<<(unsigned long);
  111.   virtual RWvostream&    operator<<(short);
  112.   virtual RWvostream&    operator<<(unsigned short);
  113.  
  114.   virtual RWvostream&    put(char);
  115.   virtual RWvostream&    put(const char* p, unsigned N);
  116. #ifndef CHAR_MATCHES_UCHAR
  117.   virtual RWvostream&    put(unsigned char);
  118.   virtual RWvostream&    put(const unsigned char* p, unsigned N);
  119. #endif
  120.   virtual RWvostream&    put(const short* p, unsigned N);
  121.   virtual RWvostream&    put(const unsigned short* p, unsigned N);
  122.   virtual RWvostream&    put(const int* p, unsigned N);
  123.   virtual RWvostream&    put(const unsigned int* p, unsigned N);
  124.   virtual RWvostream&    put(const long* p, unsigned N);
  125.   virtual RWvostream&    put(const unsigned long* p, unsigned N);
  126.   virtual RWvostream&    put(const float* p, unsigned N);
  127.   virtual RWvostream&    put(const double* p, unsigned N);
  128. };
  129.  
  130. pragma pop_align_members();
  131. #endif /* __RWBSTREAM_H__ */
  132.