[流解析 vs 2005]ios_base

vs 2005中ios_base继承自_Iosb<int>,主要提供流状态控制、格式控制、本地化等方面支持。

 

1、类型和数据定义

class ios_base : public _Iosb<int>
{
public:
	// 预定义类型
	_BITMASK(_Fmtflags, fmtflags);	// 其实是typedef int fmtflags  第一个方便理解
	_BITMASK(_Iostate, iostate);
	_BITMASK(_Openmode, openmode);
	_BITMASK(_Seekdir, seekdir);

	typedef std::streamoff streamoff;
	typedef std::streampos streampos;

	enum event
	{	// constants for ios events
		erase_event, imbue_event, copyfmt_event};

	typedef void (__CLRCALL_OR_CDECL *event_callback)(event, ios_base&, int);

	class failure	// 用于抛出异常。
		: public runtime_error
	{
	public:
		explicit failure(const string &_Message)
			: runtime_error(_Message) {}
		virtual ~failure() throw () {}
#if !_HAS_EXCEPTIONS
	protected:
		virtual void _Doraise() const		// exception中有相关信息
		{	// report the exception
			_RAISE(*this);
		}
#endif  /* _HAS_EXCEPTIONS */
	};

	class Init	// 作用?
	{	// controller for standard-stream initialization
	public:
		Init() { _Init_ctor(this); }
		~Init() { _Init_dtor(this); }
	private:
		static void __cdecl _Init_ctor(Init *);		// 位于iostream.cpp中
		static void __cdecl _Init_dtor(Init *);		// 位于iostream.cpp中
		static int& __cdecl _Init_cnt_func();		// 位于iostream.cpp中
		static int _Init_cnt;	// net constructions - destructions
	};

	// ...
private:
	iostate _Mystate;	// stream state
	iostate _Except;	// exception mask
	fmtflags _Fmtfl;	// fo
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值