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

  1. #ifndef __RWINT_H__
  2. #define __RWINT_H__
  3. pragma push_align_members(64);
  4.  
  5. /*
  6.  * Declarations for an integer class.
  7.  *
  8.  * $Header:   E:/vcs/rw/rwint.h_v   1.2   18 Feb 1992 09:54:40   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/rwint.h_v  $
  23.  * 
  24.  *    Rev 1.2   18 Feb 1992 09:54:40   KEFFER
  25.  * 
  26.  *    Rev 1.1   28 Oct 1991 09:08:20   keffer
  27.  * Changed inclusions to <rw/xxx.h>
  28.  * 
  29.  *    Rev 1.0   28 Jul 1991 08:16:28   keffer
  30.  * Tools.h++ V4.0.5 PVCS baseline version
  31.  *
  32.  */
  33.  
  34. #include "rw/tooldefs.h"
  35. #include "rw/rstream.h"
  36.  
  37. class RWExport RWInteger{
  38.   int             intBase;
  39. public:
  40.   RWInteger(int i=0)     {intBase = i;}
  41.  
  42.   RWBoolean        operator==(const RWInteger& i) const {return intBase==i.intBase;}
  43.  
  44. #ifndef ZTC_TYPE_CONVERSION_BUG  
  45.   operator        int() const {return intBase;}
  46. #endif
  47.   unsigned        binaryStoreSize() const        {return sizeof(int);}
  48.   void            restoreFrom(RWvistream& s);
  49.   void            restoreFrom(RWFile& f);
  50.   void            saveOn(RWvostream& s) const;
  51.   void            saveOn(RWFile& f) const;
  52.  
  53.   int            value() const {return intBase;}
  54.   int            value(int newval) {int temp=intBase; intBase=newval; return temp;}
  55.  
  56.   friend ostream&      operator<<(ostream& o, const RWInteger& x)
  57.                     { return o << x.intBase; }
  58.   friend istream&      operator>>(istream& i, RWInteger& x)
  59.                     { return i >> x.intBase;}
  60. };
  61.  
  62. pragma pop_align_members();
  63. #endif /* __RWINT_H__ */
  64.