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.

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