stdiostr.h

来自「根据给定的程序进行调试」· C头文件 代码 · 共 53 行

H
53
字号
/* stdiostream.h -- class stdiobuf and stdiostream declarations

    Copyright (c) 1990 by Borland International    
	All rights reserved

  NOTE: These are inefficient and obsolete.  Use the standard classes and
	functions in <fstream.h> instead.
*/

#ifndef __STDSTREAM_H
#define __STDSTREAM_H

#include <iostream.h>
#include <stdio.h>

#if __STDC__
#define _Cdecl
#else
#define _Cdecl	cdecl
#endif

class stdiobuf : public streambuf {
public:
		_Cdecl stdiobuf(FILE*);
	FILE*	_Cdecl stdiofile();
		_Cdecl ~stdiobuf();

virtual	int	_Cdecl overflow(int=EOF);
virtual	int	_Cdecl pbackfail(int);
virtual	int	_Cdecl sync();
virtual	streampos _Cdecl seekoff(streamoff, seek_dir, int);
virtual	int	_Cdecl underflow();

private:
	FILE*	sio;			
	char	lahead[2];
};
inline	FILE*	_Cdecl stdiobuf::stdiofile() { return sio; }


class stdiostream : public ios {
public:
		_Cdecl stdiostream(FILE*);
		_Cdecl ~stdiostream();
	stdiobuf* _Cdecl rdbuf();

private:
	stdiobuf buf;
};
inline	stdiobuf* _Cdecl stdiostream::rdbuf() { return &buf; }

#endif

⌨️ 快捷键说明

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