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.

55 lines
1.4 KiB

  1. /***
  2. *stdiostr.h - definitions/declarations for stdiobuf, stdiostream
  3. *
  4. * Copyright (c) 1991-1992, 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. #include <iostream.h>
  13. #include <stdio.h>
  14. // Force word packing to avoid possible -Zp override
  15. #pragma pack(2)
  16. #pragma warning(disable:4505) // disable unwanted /W4 warning
  17. // #pragma warning(default:4505) // use this to reenable, if necessary
  18. #ifndef _INC_STDIOSTREAM
  19. #define _INC_STDIOSTREAM
  20. class stdiobuf : public streambuf {
  21. public:
  22. stdiobuf(FILE* f);
  23. FILE * stdiofile() { return _str; }
  24. virtual int pbackfail(int c);
  25. virtual int overflow(int c = EOF);
  26. virtual int underflow();
  27. virtual streampos seekoff( streamoff, ios::seek_dir, int =ios::in|ios::out);
  28. virtual int sync();
  29. ~stdiobuf();
  30. int setrwbuf(int _rsize, int _wsize); // CONSIDER: move to ios::
  31. // protected:
  32. // virtual int doallocate();
  33. private:
  34. FILE * _str;
  35. };
  36. // obsolescent
  37. class stdiostream : public iostream { // note: spec.'d as : public IOS...
  38. public:
  39. stdiostream(FILE *);
  40. ~stdiostream();
  41. stdiobuf* rdbuf() const { return (stdiobuf*) ostream::rdbuf(); }
  42. private:
  43. };
  44. // Restore default packing
  45. #pragma pack()
  46. #endif