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.

77 lines
1.7 KiB

  1. /***
  2. *stdiostr.h - definitions/declarations for stdiobuf, stdiostream
  3. *
  4. * Copyright (c) 1991-1994, 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. ****/
  12. #ifndef _INC_STDIOSTREAM
  13. #define _INC_STDIOSTREAM
  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. #include <iostream.h>
  29. #include <stdio.h>
  30. #ifdef _MSC_VER
  31. // Force word packing to avoid possible -Zp override
  32. #pragma pack(push,4)
  33. #pragma warning(disable:4505) // disable unwanted /W4 warning
  34. // #pragma warning(default:4505) // use this to reenable, if necessary
  35. #endif // _MSC_VER
  36. class _CRTIMP stdiobuf : public streambuf {
  37. public:
  38. stdiobuf(FILE* f);
  39. FILE * stdiofile() { return _str; }
  40. virtual int pbackfail(int c);
  41. virtual int overflow(int c = EOF);
  42. virtual int underflow();
  43. virtual streampos seekoff( streamoff, ios::seek_dir, int =ios::in|ios::out);
  44. virtual int sync();
  45. ~stdiobuf();
  46. int setrwbuf(int _rsize, int _wsize); // CONSIDER: move to ios::
  47. // protected:
  48. // virtual int doallocate();
  49. private:
  50. FILE * _str;
  51. };
  52. // obsolescent
  53. class _CRTIMP stdiostream : public iostream { // note: spec.'d as : public IOS...
  54. public:
  55. stdiostream(FILE *);
  56. ~stdiostream();
  57. stdiobuf* rdbuf() const { return (stdiobuf*) ostream::rdbuf(); }
  58. private:
  59. };
  60. #ifdef _MSC_VER
  61. // Restore default packing
  62. #pragma pack(pop)
  63. #endif // _MSC_VER
  64. #endif // !_INC_STDIOSTREAM