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.

87 lines
2.0 KiB

  1. /***
  2. *iostream.h - definitions/declarations for iostream classes
  3. *
  4. * Copyright (c) 1990-1994, 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. ****/
  12. #ifndef _INC_IOSTREAM
  13. #define _INC_IOSTREAM
  14. /* Define _CRTIMP */
  15. #ifndef _CRTIMP
  16. #ifdef _NTSDK
  17. /* definition compatible with NT SDK */
  18. #define _CRTIMP
  19. #else /* ndef _NTSDK */
  20. /* current definition */
  21. #ifdef _DLL
  22. #define _CRTIMP __declspec(dllimport)
  23. #else /* ndef _DLL */
  24. #define _CRTIMP
  25. #endif /* _DLL */
  26. #endif /* _NTSDK */
  27. #endif /* _CRTIMP */
  28. typedef long streamoff, streampos;
  29. #include <ios.h> // Define ios.
  30. #include <streamb.h> // Define streambuf.
  31. #include <istream.h> // Define istream.
  32. #include <ostream.h> // Define ostream.
  33. #ifdef _MSC_VER
  34. // C4505: "unreferenced local function has been removed"
  35. #pragma warning(disable:4505) // disable C4505 warning
  36. // #pragma warning(default:4505) // use this to reenable, if desired
  37. // Force word packing to avoid possible -Zp override
  38. #pragma pack(push,4)
  39. #endif // _MSC_VER
  40. class _CRTIMP iostream : public istream, public ostream {
  41. public:
  42. iostream(streambuf*);
  43. virtual ~iostream();
  44. protected:
  45. // consider: make private??
  46. iostream();
  47. iostream(const iostream&);
  48. inline iostream& operator=(streambuf*);
  49. inline iostream& operator=(iostream&);
  50. private:
  51. iostream(ios&);
  52. iostream(istream&);
  53. iostream(ostream&);
  54. };
  55. inline iostream& iostream::operator=(streambuf* _sb) { istream::operator=(_sb); ostream::operator=(_sb); return *this; }
  56. inline iostream& iostream::operator=(iostream& _strm) { return operator=(_strm.rdbuf()); }
  57. class _CRTIMP Iostream_init {
  58. public:
  59. Iostream_init();
  60. Iostream_init(ios &, int =0); // treat as private
  61. ~Iostream_init();
  62. };
  63. // used internally
  64. // static Iostream_init __iostreaminit; // initializes cin/cout/cerr/clog
  65. #ifdef _MSC_VER
  66. // Restore previous packing
  67. #pragma pack(pop)
  68. #endif // _MSC_VER
  69. #endif /* !_INC_IOSTREAM */