x
Yes
No
Do you want to visit DriveHQ English website?
首页
产品服务
价格
免费试用
下载客户端
关于我们
云文件服务
|
云备份服务
|
FTP服务
|
企业邮箱服务
|
网站托管
|
客户端软件
云文件服务
云备份服务
FTP服务
企业级邮箱服务
网站托管
客户端软件
chainbuf.hpp - Hosted on DriveHQ Cloud IT Platform
返回上层目录
上传
下载
共享
发布
新建文件夹
新建文件
复制
剪切
删除
粘贴
评论
升级服务
路径: \\game3dprogramming\materials\GameFactory\GameFactoryDemo\references\boost_1_35_0\boost\iostreams\detail\streambuf\chainbuf.hpp
旋转
特效
属性
历史版本
// (C) Copyright 2008 CodeRage, LLC (turkanis at coderage dot com) // (C) Copyright 2003-2007 Jonathan Turkanis // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.) // See http://www.boost.org/libs/iostreams for documentation. #ifndef BOOST_IOSTREAMS_DETAIL_CHAINBUF_HPP_INCLUDED #define BOOST_IOSTREAMS_DETAIL_CHAINBUF_HPP_INCLUDED #if defined(_MSC_VER) && (_MSC_VER >= 1020) # pragma once #endif #include
// BOOST_MSVC, template friends. #include
#include
#include
#include
#include
#include
#include
#include
#include
namespace boost { namespace iostreams { namespace detail { //--------------Definition of chainbuf----------------------------------------// // // Template name: chainbuf. // Description: Stream buffer which operates by delegating to the first // linked_streambuf in a chain. // Template paramters: // Chain - The chain type. // template
class chainbuf : public BOOST_IOSTREAMS_BASIC_STREAMBUF( typename Chain::char_type, typename Chain::traits_type ), public access_control
, private noncopyable { private: typedef access_control
, Access> client_type; public: typedef typename Chain::char_type char_type; BOOST_IOSTREAMS_STREAMBUF_TYPEDEFS(typename Chain::traits_type) protected: typedef linked_streambuf
delegate_type; chainbuf() { client_type::set_chain(&chain_); } int_type underflow() { sentry t(this); return translate(delegate().underflow()); } int_type pbackfail(int_type c) { sentry t(this); return translate(delegate().pbackfail(c)); } std::streamsize xsgetn(char_type* s, std::streamsize n) { sentry t(this); return delegate().xsgetn(s, n); } int_type overflow(int_type c) { sentry t(this); return translate(delegate().overflow(c)); } std::streamsize xsputn(const char_type* s, std::streamsize n) { sentry t(this); return delegate().xsputn(s, n); } int sync() { sentry t(this); return delegate().sync(); } pos_type seekoff( off_type off, BOOST_IOS::seekdir way, BOOST_IOS::openmode which = BOOST_IOS::in | BOOST_IOS::out ) { sentry t(this); return delegate().seekoff(off, way, which); } pos_type seekpos( pos_type sp, BOOST_IOS::openmode which = BOOST_IOS::in | BOOST_IOS::out ) { sentry t(this); return delegate().seekpos(sp, which); } protected: typedef BOOST_IOSTREAMS_BASIC_STREAMBUF( typename Chain::char_type, typename Chain::traits_type ) base_type; //#if !BOOST_WORKAROUND(__GNUC__, == 2) // BOOST_IOSTREAMS_USING_PROTECTED_STREAMBUF_MEMBERS(base_type) //#endif private: // Translate from std int_type to chain's int_type. typedef BOOST_IOSTREAMS_CHAR_TRAITS(char_type) std_traits; typedef typename Chain::traits_type chain_traits; static typename chain_traits::int_type translate(typename std_traits::int_type c) { return translate_int_type
(c); } delegate_type& delegate() { return static_cast
(chain_.front()); } void get_pointers() { this->setg(delegate().eback(), delegate().gptr(), delegate().egptr()); this->setp(delegate().pbase(), delegate().epptr()); this->pbump((int) (delegate().pptr() - delegate().pbase())); } void set_pointers() { delegate().setg(this->eback(), this->gptr(), this->egptr()); delegate().setp(this->pbase(), this->epptr()); delegate().pbump((int) (this->pptr() - this->pbase())); } struct sentry { sentry(chainbuf
* buf) : buf_(buf) { buf_->set_pointers(); } ~sentry() { buf_->get_pointers(); } chainbuf
* buf_; }; friend struct sentry; Chain chain_; }; } } } // End namespaces detail, iostreams, boost. #endif // #ifndef BOOST_IOSTREAMS_DETAIL_CHAINBUF_HPP_INCLUDED
chainbuf.hpp
网页地址
文件地址
上一页 1/4
下一页
下载
( 4 KB )
Comments
Total ratings:
0
Average rating:
无评论
of 10
Would you like to comment?
Join now
, or
Logon
if you are already a member.