Leaked source code of windows server 2003
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.

152 lines
4.2 KiB

  1. /***
  2. *iostream.h - definitions/declarations for iostream classes
  3. *
  4. * Copyright (c) 1990-2001, 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. *Revision History:
  14. * 01-23-92 KRS Ported from 16-bit version.
  15. * 02-23-92 KRS Added cruntime.h.
  16. * 02-23-93 SKS Update copyright to 1993
  17. * 03-23-93 CFW Modified #pragma warnings.
  18. * 09-01-93 GJF Merged Cuda and NT SDK versions.
  19. * 10-13-93 GJF Deleted obsolete COMBOINC check. Enclose #pragma-s
  20. * in #ifdef _MSC_VER
  21. * 08-12-94 GJF Disable warning 4514 instead of 4505.
  22. * 11-03-94 GJF Changed pack pragma to 8 byte alignment.
  23. * 02-11-95 CFW Add _CRTBLD to avoid users getting wrong headers.
  24. * 02-14-95 CFW Clean up Mac merge.
  25. * 05-11-95 CFW Only for use by C++ programs.
  26. * 12-14-95 JWM Add "#pragma once".
  27. * 04-09-96 SKS Change _CRTIMP to _CRTIMP1 for special iostream build
  28. * 04-15-96 JWM Remove _OLD_IOSTREAMS, add '#pragma comment(lib,"cirt")'.
  29. * 04-16-96 JWM '#include useoldio.h' replaces '#pragma comment(...)'.
  30. * 02-21-97 GJF Cleaned out obsolete support for _NTSDK. Also,
  31. * detab-ed.
  32. * 05-17-99 PML Remove all Macintosh support.
  33. *
  34. ****/
  35. #if _MSC_VER > 1000 /*IFSTRIP=IGN*/
  36. #pragma once
  37. #endif
  38. #ifdef __cplusplus
  39. #ifndef _INC_IOSTREAM
  40. #define _INC_IOSTREAM
  41. #if !defined(_WIN32)
  42. #error ERROR: Only Win32 target supported!
  43. #endif
  44. #ifndef _CRTBLD
  45. /* This version of the header files is NOT for user programs.
  46. * It is intended for use when building the C runtimes ONLY.
  47. * The version intended for public use will not have this message.
  48. */
  49. #error ERROR: Use of C runtime library internal header file.
  50. #endif /* _CRTBLD */
  51. #ifdef _MSC_VER
  52. // Currently, all MS C compilers for Win32 platforms default to 8 byte
  53. // alignment.
  54. #pragma pack(push,8)
  55. #include <useoldio.h>
  56. #endif // _MSC_VER
  57. #ifndef _INTERNAL_IFSTRIP_
  58. #include <cruntime.h>
  59. #ifndef _WINSTATIC
  60. #define _WINSTATIC
  61. #endif
  62. #endif /* !_INTERNAL_IFSTRIP_ */
  63. /* Define _CRTIMP */
  64. #ifndef _CRTIMP
  65. #ifdef CRTDLL
  66. #define _CRTIMP __declspec(dllexport)
  67. #else /* ndef CRTDLL */
  68. #ifdef _DLL
  69. #define _CRTIMP __declspec(dllimport)
  70. #else /* ndef _DLL */
  71. #define _CRTIMP
  72. #endif /* _DLL */
  73. #endif /* CRTDLL */
  74. #endif /* _CRTIMP */
  75. #ifndef _INTERNAL_IFSTRIP_
  76. /* Define _CRTIMP1 */
  77. #ifndef _CRTIMP1
  78. #ifdef CRTDLL1
  79. #define _CRTIMP1 __declspec(dllexport)
  80. #else /* ndef CRTDLL1 */
  81. #define _CRTIMP1 _CRTIMP
  82. #endif /* CRTDLL1 */
  83. #endif /* _CRTIMP1 */
  84. #endif /* _INTERNAL_IFSTRIP_ */
  85. typedef long streamoff, streampos;
  86. #include <ios.h> // Define ios.
  87. #include <streamb.h> // Define streambuf.
  88. #include <istream.h> // Define istream.
  89. #include <ostream.h> // Define ostream.
  90. #ifdef _MSC_VER
  91. // C4514: "unreferenced inline function has been removed"
  92. #pragma warning(disable:4514) // disable C4514 warning
  93. // #pragma warning(default:4514) // use this to reenable, if desired
  94. #endif // _MSC_VER
  95. class _CRTIMP1 iostream : public istream, public ostream {
  96. public:
  97. iostream(streambuf*);
  98. virtual ~iostream();
  99. protected:
  100. iostream();
  101. iostream(const iostream&);
  102. inline iostream& operator=(streambuf*);
  103. inline iostream& operator=(iostream&);
  104. private:
  105. iostream(ios&);
  106. iostream(istream&);
  107. iostream(ostream&);
  108. };
  109. inline iostream& iostream::operator=(streambuf* _sb) { istream::operator=(_sb); ostream::operator=(_sb); return *this; }
  110. inline iostream& iostream::operator=(iostream& _strm) { return operator=(_strm.rdbuf()); }
  111. class _CRTIMP1 Iostream_init {
  112. public:
  113. Iostream_init();
  114. Iostream_init(ios &, int =0); // treat as private
  115. ~Iostream_init();
  116. };
  117. // used internally
  118. // static Iostream_init __iostreaminit; // initializes cin/cout/cerr/clog
  119. #ifdef _MSC_VER
  120. // Restore previous packing
  121. #pragma pack(pop)
  122. #endif // _MSC_VER
  123. #endif // _INC_IOSTREAM
  124. #endif /* __cplusplus */