Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

100 lines
2.1 KiB

  1. /***
  2. *iostream.h - definitions/declarations for iostream classes
  3. *
  4. * Copyright (c) 1990-1995, 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. #ifdef __cplusplus
  15. #ifndef _INC_IOSTREAM
  16. #define _INC_IOSTREAM
  17. #if !defined(_WIN32) && !defined(_MAC)
  18. #error ERROR: Only Mac or Win32 targets supported!
  19. #endif
  20. #ifdef _MSC_VER
  21. // Currently, all MS C compilers for Win32 platforms default to 8 byte
  22. // alignment.
  23. #pragma pack(push,8)
  24. #endif // _MSC_VER
  25. /* Define _CRTIMP */
  26. #ifndef _CRTIMP
  27. #ifdef _NTSDK
  28. /* definition compatible with NT SDK */
  29. #define _CRTIMP
  30. #else /* ndef _NTSDK */
  31. /* current definition */
  32. #ifdef _DLL
  33. #define _CRTIMP __declspec(dllimport)
  34. #else /* ndef _DLL */
  35. #define _CRTIMP
  36. #endif /* _DLL */
  37. #endif /* _NTSDK */
  38. #endif /* _CRTIMP */
  39. typedef long streamoff, streampos;
  40. #include <ios.h> // Define ios.
  41. #include <streamb.h> // Define streambuf.
  42. #include <istream.h> // Define istream.
  43. #include <ostream.h> // Define ostream.
  44. #ifdef _MSC_VER
  45. // C4514: "unreferenced inline function has been removed"
  46. #pragma warning(disable:4514) // disable C4514 warning
  47. // #pragma warning(default:4514) // use this to reenable, if desired
  48. #endif // _MSC_VER
  49. class _CRTIMP iostream : public istream, public ostream {
  50. public:
  51. iostream(streambuf*);
  52. virtual ~iostream();
  53. protected:
  54. iostream();
  55. iostream(const iostream&);
  56. inline iostream& operator=(streambuf*);
  57. inline iostream& operator=(iostream&);
  58. private:
  59. iostream(ios&);
  60. iostream(istream&);
  61. iostream(ostream&);
  62. };
  63. inline iostream& iostream::operator=(streambuf* _sb) { istream::operator=(_sb); ostream::operator=(_sb); return *this; }
  64. inline iostream& iostream::operator=(iostream& _strm) { return operator=(_strm.rdbuf()); }
  65. class _CRTIMP Iostream_init {
  66. public:
  67. Iostream_init();
  68. Iostream_init(ios &, int =0); // treat as private
  69. ~Iostream_init();
  70. };
  71. // used internally
  72. // static Iostream_init __iostreaminit; // initializes cin/cout/cerr/clog
  73. #ifdef _MSC_VER
  74. // Restore previous packing
  75. #pragma pack(pop)
  76. #endif // _MSC_VER
  77. #endif // _INC_IOSTREAM
  78. #endif /* __cplusplus */