• <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>
  • C++的流basic_streambuf

    發表于:2008-04-22來源:作者:點擊數: 標簽:streambufbasic
    關鍵字:basic_streambufC++的流basic_streambuf 不是個抽象類,但是他是C++流的基類.它提供了基本的緩沖區管理.它包含六個緩存區指針,三個分別是讀指針(開頭,結尾,當前),另外三個是寫指針(開頭,結尾,當前) 讀開始指針當前讀指針讀結尾指針 _M_gbegin_M_gnext_
    關鍵字:basic_streambufC++的流basic_streambuf
    不是個抽象類,但是他是C++流的基類.它提供了基本的緩沖區管理.它包含六個緩存區指針,三個分別是讀指針(開頭,結尾,當前),另外三個是寫指針(開頭,結尾,當前)
     
        讀開始指針                            當前讀指針                                    讀結尾指針
    _M_gbegin                          _M_gnext                      _M_gend
             
             =========================================================     
                  ^                                                      ^                                              ^
           _M_pbegin                          _M_pnext                      _M_pend
               寫開始指針                            當前寫指針                           寫結尾指針
     
    template <class_CharT, class_Traits>
    classbasic_streambuf
    {
     friendclassbasic_istream<_CharT, _Traits>;
     friendclassbasic_ostream<_CharT, _Traits>;
    public:                         // Typedefs.
     typedef_CharT                   char_type;
     typedeftypename_Traits::int_type        int_type;
     typedeftypename_Traits::pos_type     pos_type;
     typedeftypename_Traits::off_type       off_type;
     typedef_Traits                    traits_type;
     
    public:                         // Destructor.
     virtual ~basic_streambuf() {}
     
    public:                         // Locale-related functions.
     localepubimbue(constlocale& __loc) {
        this->imbue(__loc);
        locale__tmp = _M_locale;
        _M_locale = __loc;
        return__tmp;
     }
     localegetloc() const { return_M_locale; }
     
    public:                         // Buffer management.
     //設置緩沖區和長度
     basic_streambuf* pubsetbuf(char_type* __s, streamsize__n) 
        { returnthis->setbuf(__s, __n); }
     
     //設置緩沖區偏移量,簡單調用seekoff()函數
     pos_typepubseekoff(off_type__offset, ios_base::seekdir__way,
                          ios_base::openmode__mod = ios_base::in | ios_base::out)
        { returnthis->seekoff(__offset, __way, __mod); }
    //設置緩沖區位置,簡單調用seekpos()函數
     pos_typepubseekpos(pos_type__sp,
                          ios_base::openmode__mod = ios_base::in | ios_base::out)
        { returnthis->seekpos(__sp, __mod); }
     
    //放置緩沖區同步,簡單調用sync()函數
     intpubsync() { returnthis->sync(); }

    原文轉自:http://www.kjueaiud.com

    老湿亚洲永久精品ww47香蕉图片_日韩欧美中文字幕北美法律_国产AV永久无码天堂影院_久久婷婷综合色丁香五月

  • <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>