⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mystream.h

📁 国外网站上的一些精典的C程序
💻 H
字号:
// Mystream.h// iostream interface for class Myio// Defines the following classes://  Mystreambuf     derived from streambuf - buffer management & I/O interface//  Mystreambase    base class used for initialisation & object reference//  Myiostream      customised iostream, derived from iostream/Mystreambase//// Written by David L Nugent, June 1993//# if !defined(_Mystream_h)# define _Mystream_h 1# include <iostream.h># include "Myio.h"    //    // Mystreambuf    // This is the class which does all the actual I/O    // handling and (optional) buffer management    //class Mystreambuf : public streambuf{  public:    Mystreambuf (Myio * mPtr);  protected:    virtual int overflow (int = EOF);    virtual int underflow ();    virtual int sync ();  private:    Myio * mptr;    // Points to the Myio instance to                    // which this stream is attached    char _back[2];  // Holder for putback};class Mystreambase : public virtual ios{  public:    Mystreambase (Myio * mPtr);    Mystreambuf * rdbuf (void);  protected:    Mystreambuf mystreambuf;};inlineMystreambase::Mystreambase (Myio * mPtr)    : mystreambuf (mPtr){}inline Mystreambuf *Mystreambase::rdbuf (void)    {   return &mystreambuf;    }class Mystream : public Mystreambase, public iostream{  public:    Mystream (Myio * mPtr);    ~Mystream (void);};    //    // class Mystream constructor    // This uses Mystreambase to set up the Mystreambuf    // which can then be used to initialise iostream.    //inlineMystream::Mystream (Myio * m)    : Mystreambase (m), iostream (rdbuf()){}inlineMystream::~Mystream (void)    {}# endif     // _Mystream_h

⌨️ 快捷键说明

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