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.

90 lines
1.9 KiB

  1. /***
  2. *stdiostr.h - definitions/declarations for stdiobuf, stdiostream
  3. *
  4. * Copyright (c) 1991-1995, Microsoft Corporation. All rights reserved.
  5. *
  6. *Purpose:
  7. * This file defines the classes, values, macros, and functions
  8. * used by the stdiostream and stdiobuf classes.
  9. * [AT&T C++]
  10. *
  11. * [Public]
  12. *
  13. ****/
  14. #ifdef __cplusplus
  15. #ifndef _INC_STDIOSTREAM
  16. #define _INC_STDIOSTREAM
  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. #include <iostream.h>
  40. #include <stdio.h>
  41. #ifdef _MSC_VER
  42. #pragma warning(disable:4514) // disable unwanted /W4 warning
  43. // #pragma warning(default:4514) // use this to reenable, if necessary
  44. #endif // _MSC_VER
  45. class _CRTIMP stdiobuf : public streambuf {
  46. public:
  47. stdiobuf(FILE* f);
  48. FILE * stdiofile() { return _str; }
  49. virtual int pbackfail(int c);
  50. virtual int overflow(int c = EOF);
  51. virtual int underflow();
  52. virtual streampos seekoff( streamoff, ios::seek_dir, int =ios::in|ios::out);
  53. virtual int sync();
  54. ~stdiobuf();
  55. int setrwbuf(int _rsize, int _wsize);
  56. // protected:
  57. // virtual int doallocate();
  58. private:
  59. FILE * _str;
  60. };
  61. // obsolescent
  62. class _CRTIMP stdiostream : public iostream { // note: spec.'d as : public IOS...
  63. public:
  64. stdiostream(FILE *);
  65. ~stdiostream();
  66. stdiobuf* rdbuf() const { return (stdiobuf*) ostream::rdbuf(); }
  67. private:
  68. };
  69. #ifdef _MSC_VER
  70. // Restore default packing
  71. #pragma pack(pop)
  72. #endif // _MSC_VER
  73. #endif // _INC_STDIOSTREAM
  74. #endif /* __cplusplus */