x
Yes
No
Do you want to visit DriveHQ English website?
首页
产品服务
价格
免费试用
下载客户端
关于我们
云文件服务
|
云备份服务
|
FTP服务
|
企业邮箱服务
|
网站托管
|
客户端软件
云文件服务
云备份服务
FTP服务
企业级邮箱服务
网站托管
客户端软件
stdio.hpp - Hosted on DriveHQ Cloud IT Platform
返回上层目录
上传
下载
共享
发布
新建文件夹
新建文件
复制
剪切
删除
粘贴
评论
升级服务
路径: \\game3dprogramming\materials\GameFactory\GameFactoryDemo\references\boost_1_35_0\boost\iostreams\filter\stdio.hpp
旋转
特效
属性
历史版本
// (C) Copyright 2008 CodeRage, LLC (turkanis at coderage dot com) // (C) Copyright 2005-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. // Based on the work of Christopher Diggins. #ifndef BOOST_IOSTREAMS_STDIO_FILTER_HPP_INCLUDED #define BOOST_IOSTREAMS_STDIO_FILTER_HPP_INCLUDED #if defined(_MSC_VER) && (_MSC_VER >= 1020) # pragma once #endif #include
#include
// allocator. #include
#include
#include
#include
#include
#include
#include
#include
#include
namespace boost { namespace iostreams { namespace detail { } // End namespace detail. template
> class basic_stdio_filter : public aggregate_filter
{ private: typedef aggregate_filter
base_type; public: typedef typename base_type::char_type char_type; typedef typename base_type::category category; typedef typename base_type::vector_type vector_type; private: static std::istream& standard_input(char*) { return std::cin; } static std::ostream& standard_output(char*) { return std::cout; } #ifndef BOOST_IOSTREAMS_NO_WIDE_STREAMS static std::wistream& standard_input(wchar_t*) { return std::wcin; } static std::wostream& standard_output(wchar_t*) { return std::wcout; } #endif // BOOST_IOSTREAMS_NO_WIDE_STREAMS struct scoped_redirector { // Thanks to Maxim Egorushkin. typedef BOOST_IOSTREAMS_CHAR_TRAITS(Ch) traits_type; typedef BOOST_IOSTREAMS_BASIC_IOS(Ch, traits_type) ios_type; typedef BOOST_IOSTREAMS_BASIC_STREAMBUF(Ch, traits_type) streambuf_type; scoped_redirector( ios_type& ios, streambuf_type* newbuf ) : ios_(ios), old_(ios.rdbuf(newbuf)) { } ~scoped_redirector() { ios_.rdbuf(old_); } scoped_redirector& operator=(const scoped_redirector&); ios_type& ios_; streambuf_type* old_; }; virtual void do_filter() = 0; virtual void do_filter(const vector_type& src, vector_type& dest) { stream_buffer< basic_array_source
> srcbuf(&src[0], &src[0] + src.size()); stream_buffer< back_insert_device
> destbuf(iostreams::back_inserter(dest)); scoped_redirector redirect_input(standard_input((Ch*)0), &srcbuf); scoped_redirector redirect_output(standard_output((Ch*)0), &destbuf); do_filter(); } }; BOOST_IOSTREAMS_PIPABLE(basic_stdio_filter, 2) typedef basic_stdio_filter
stdio_filter; typedef basic_stdio_filter
wstdio_wfilter; } } // End namespaces iostreams, boost. #endif // #ifndef BOOST_IOSTREAMS_STDIO_FILTER_HPP_INCLUDED
stdio.hpp
网页地址
文件地址
上一页
8/11
下一页
下载
( 3 KB )
Comments
Total ratings:
0
Average rating:
无评论
of 10
Would you like to comment?
Join now
, or
Logon
if you are already a member.