home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / vc98 / include / iostream.h < prev    next >
C/C++ Source or Header  |  1998-06-16  |  2KB  |  103 lines

  1. /***
  2. *iostream.h - definitions/declarations for iostream classes
  3. *
  4. *       Copyright (c) 1990-1997, Microsoft Corporation.  All rights reserved.
  5. *
  6. *Purpose:
  7. *       This file defines the classes, values, macros, and functions
  8. *       used by the iostream classes.
  9. *       [AT&T C++]
  10. *
  11. *       [Public]
  12. *
  13. ****/
  14.  
  15. #if     _MSC_VER > 1000
  16. #pragma once
  17. #endif
  18.  
  19. #ifdef  __cplusplus
  20.  
  21. #ifndef _INC_IOSTREAM
  22. #define _INC_IOSTREAM
  23.  
  24. #if     !defined(_WIN32) && !defined(_MAC)
  25. #error ERROR: Only Mac or Win32 targets supported!
  26. #endif
  27.  
  28.  
  29. #ifdef  _MSC_VER
  30. // Currently, all MS C compilers for Win32 platforms default to 8 byte
  31. // alignment.
  32. #pragma pack(push,8)
  33.  
  34. #include <useoldio.h>
  35.  
  36. #endif  // _MSC_VER
  37.  
  38.  
  39. /* Define _CRTIMP */
  40.  
  41. #ifndef _CRTIMP
  42. #ifdef  _DLL
  43. #define _CRTIMP __declspec(dllimport)
  44. #else   /* ndef _DLL */
  45. #define _CRTIMP
  46. #endif  /* _DLL */
  47. #endif  /* _CRTIMP */
  48.  
  49.  
  50. typedef long streamoff, streampos;
  51.  
  52. #include <ios.h>                // Define ios.
  53.  
  54. #include <streamb.h>            // Define streambuf.
  55.  
  56. #include <istream.h>            // Define istream.
  57.  
  58. #include <ostream.h>            // Define ostream.
  59.  
  60. #ifdef  _MSC_VER
  61. // C4514: "unreferenced inline function has been removed"
  62. #pragma warning(disable:4514) // disable C4514 warning
  63. // #pragma warning(default:4514)        // use this to reenable, if desired
  64. #endif  // _MSC_VER
  65.  
  66. class _CRTIMP iostream : public istream, public ostream {
  67. public:
  68.         iostream(streambuf*);
  69.         virtual ~iostream();
  70. protected:
  71.         iostream();
  72.         iostream(const iostream&);
  73. inline iostream& operator=(streambuf*);
  74. inline iostream& operator=(iostream&);
  75. private:
  76.         iostream(ios&);
  77.         iostream(istream&);
  78.         iostream(ostream&);
  79. };
  80.  
  81. inline iostream& iostream::operator=(streambuf* _sb) { istream::operator=(_sb); ostream::operator=(_sb); return *this; }
  82.  
  83. inline iostream& iostream::operator=(iostream& _strm) { return operator=(_strm.rdbuf()); }
  84.  
  85. class _CRTIMP Iostream_init {
  86. public:
  87.         Iostream_init();
  88.         Iostream_init(ios &, int =0);   // treat as private
  89.         ~Iostream_init();
  90. };
  91.  
  92. // used internally
  93. // static Iostream_init __iostreaminit; // initializes cin/cout/cerr/clog
  94.  
  95. #ifdef  _MSC_VER
  96. // Restore previous packing
  97. #pragma pack(pop)
  98. #endif  // _MSC_VER
  99.  
  100. #endif  // _INC_IOSTREAM
  101.  
  102. #endif  /* __cplusplus */
  103.