stdiobuf.mh

来自「开放源码的编译器open watcom 1.6.0版的源代码」· MH 代码 · 共 54 行

MH
54
字号
///////////////////////////////////////////////////////////////////////////
// FILE: stdiobuf.h (Standard I/O streams)
//
:keep CPP_HDR
:include crwat.sp
//
// Description: This header contains a streambuf class that uses the C
//              standard library as its input/output "device".
///////////////////////////////////////////////////////////////////////////
#ifndef _STDIOBUF_H_INCLUDED
#define _STDIOBUF_H_INCLUDED
:include readonly.sp

#ifndef __cplusplus
#error stdiobuf.h is for use with C++
#endif

#ifndef _COMDEF_H_INCLUDED
 #include <_comdef.h>
#endif
#ifndef _STDIO_H_INCLUDED
 #include <stdio.h>
#endif
#ifndef _IOSTREAM_H_INCLUDED
 #include <iostream.h>
#endif

// **************************** STDIOBUF *************************************
:include pshpackl.sp
class _WPRTLINK stdiobuf : public streambuf {
public:
    stdiobuf();
    stdiobuf( FILE *__fptr );
    ~stdiobuf();

    FILE *stdiofile();

    virtual int overflow( int = EOF );
    virtual int underflow();
    virtual int sync();

private:
    FILE *__file_pointer;
    char __unbuffered_get_area[ DEFAULT_PUTBACK_SIZE+1 ];
    int : 0;
};
:include poppack.sp

inline FILE *stdiobuf::stdiofile() {
    return __file_pointer;
}

#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?