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.

94 lines
2.0 KiB

  1. /***
  2. *stdiostr.h - definitions/declarations for stdiobuf, stdiostream
  3. *
  4. * Copyright (c) 1991-2001, 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. #if _MSC_VER > 1000
  15. #pragma once
  16. #endif
  17. #ifdef __cplusplus
  18. #ifndef _INC_STDIOSTREAM
  19. #define _INC_STDIOSTREAM
  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. /* current definition */
  32. #ifdef _DLL
  33. #define _CRTIMP __declspec(dllimport)
  34. #else /* ndef _DLL */
  35. #define _CRTIMP
  36. #endif /* _DLL */
  37. #endif /* _CRTIMP */
  38. #include <iostream.h>
  39. #include <stdio.h>
  40. #ifdef _MSC_VER
  41. #pragma warning(disable:4514) // disable unwanted /W4 warning
  42. // #pragma warning(default:4514) // use this to reenable, if necessary
  43. #endif // _MSC_VER
  44. class _CRTIMP stdiobuf : public streambuf {
  45. public:
  46. stdiobuf(FILE* f);
  47. FILE * stdiofile() { return _str; }
  48. virtual int pbackfail(int c);
  49. virtual int overflow(int c = EOF);
  50. virtual int underflow();
  51. virtual streampos seekoff( streamoff, ios::seek_dir, int =ios::in|ios::out);
  52. virtual int sync();
  53. ~stdiobuf();
  54. int setrwbuf(int _rsize, int _wsize);
  55. // protected:
  56. // virtual int doallocate();
  57. private:
  58. FILE * _str;
  59. };
  60. // obsolescent
  61. class _CRTIMP stdiostream : public iostream { // note: spec.'d as : public IOS...
  62. public:
  63. stdiostream(FILE *);
  64. ~stdiostream();
  65. stdiobuf* rdbuf() const { return (stdiobuf*) ostream::rdbuf(); }
  66. private:
  67. };
  68. #ifdef _MSC_VER
  69. // Restore default packing
  70. #pragma pack(pop)
  71. #endif // _MSC_VER
  72. #endif // _INC_STDIOSTREAM
  73. #endif /* __cplusplus */