x
Yes
No
Do you want to visit DriveHQ English website?
首页
产品服务
价格
免费试用
下载客户端
关于我们
云文件服务
|
云备份服务
|
FTP服务
|
企业邮箱服务
|
网站托管
|
客户端软件
云文件服务
云备份服务
FTP服务
企业级邮箱服务
网站托管
客户端软件
array.hpp - Hosted on DriveHQ Cloud IT Platform
返回上层目录
上传
下载
共享
发布
新建文件夹
新建文件
复制
剪切
删除
粘贴
评论
升级服务
路径: \\game3dprogramming\materials\GameFactory\GameFactoryDemo\references\boost_1_35_0\boost\iostreams\device\array.hpp
旋转
特效
属性
历史版本
// (C) Copyright 2008 CodeRage, LLC (turkanis at coderage dot com) // (C) Copyright 2004-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_ARRAY_HPP_INCLUDED #define BOOST_IOSTREAMS_ARRAY_HPP_INCLUDED #if defined(_MSC_VER) && (_MSC_VER >= 1020) # pragma once #endif #include
// BOOST_MSVC, make sure size_t is in std. #include
#include
// std::size_t. #include
// pair. #include
#include
#include
#include
#include
namespace boost { namespace iostreams { namespace detail { template
class array_adapter { public: typedef Ch char_type; typedef std::pair
pair_type; struct category : public Mode, public device_tag, public direct_tag { }; array_adapter(char_type* begin, char_type* end); array_adapter(char_type* begin, std::size_t length); array_adapter(const char_type* begin, const char_type* end); array_adapter(const char_type* begin, std::size_t length); #if !BOOST_WORKAROUND(BOOST_MSVC, < 1300) template
array_adapter(char_type (&ar)[N]) : begin_(ar), end_(ar + N) { } #endif pair_type input_sequence(); pair_type output_sequence(); private: char_type* begin_; char_type* end_; }; } // End namespace detail. // Local macros, #undef'd below. #if !BOOST_WORKAROUND(BOOST_MSVC, <= 1300) # define BOOST_IOSTREAMS_ARRAY_CTOR(name, ch) \ template
\ BOOST_PP_CAT(basic_, name)(ch (&ar)[N]) \ : base_type(ar) { } \ /**/ #else # define BOOST_IOSTREAMS_ARRAY_CTOR(name, ch) #endif #define BOOST_IOSTREAMS_ARRAY(name, mode) \ template
\ struct BOOST_PP_CAT(basic_, name) : detail::array_adapter
{ \ private: \ typedef detail::array_adapter
base_type; \ public: \ typedef typename base_type::char_type char_type; \ typedef typename base_type::category category; \ BOOST_PP_CAT(basic_, name)(char_type* begin, char_type* end) \ : base_type(begin, end) { } \ BOOST_PP_CAT(basic_, name)(char_type* begin, std::size_t length) \ : base_type(begin, length) { } \ BOOST_PP_CAT(basic_, name)(const char_type* begin, const char_type* end) \ : base_type(begin, end) { } \ BOOST_PP_CAT(basic_, name)(const char_type* begin, std::size_t length) \ : base_type(begin, length) { } \ BOOST_IOSTREAMS_ARRAY_CTOR(name, Ch) \ }; \ typedef BOOST_PP_CAT(basic_, name)
name; \ typedef BOOST_PP_CAT(basic_, name)
BOOST_PP_CAT(w, name); \ /**/ BOOST_IOSTREAMS_ARRAY(array_source, input_seekable) BOOST_IOSTREAMS_ARRAY(array_sink, output_seekable) BOOST_IOSTREAMS_ARRAY(array, seekable) #undef BOOST_IOSTREAMS_ARRAY_CTOR #undef BOOST_IOSTREAMS_ARRAY //------------------Implementation of array_adapter---------------------------// namespace detail { template
array_adapter
::array_adapter (char_type* begin, char_type* end) : begin_(begin), end_(end) { } template
array_adapter
::array_adapter (char_type* begin, std::size_t length) : begin_(begin), end_(begin + length) { } template
array_adapter
::array_adapter (const char_type* begin, const char_type* end) : begin_(const_cast
(begin)), // Treated as read-only. end_(const_cast
(end)) // Treated as read-only. { BOOST_STATIC_ASSERT((!is_convertible
::value)); } template
array_adapter
::array_adapter (const char_type* begin, std::size_t length) : begin_(const_cast
(begin)), // Treated as read-only. end_(const_cast
(begin) + length) // Treated as read-only. { BOOST_STATIC_ASSERT((!is_convertible
::value)); } template
typename array_adapter
::pair_type array_adapter
::input_sequence() { BOOST_STATIC_ASSERT((is_convertible
::value)); return pair_type(begin_, end_); } template
typename array_adapter
::pair_type array_adapter
::output_sequence() { BOOST_STATIC_ASSERT((is_convertible
::value)); return pair_type(begin_, end_); } } // End namespace detail. //----------------------------------------------------------------------------// } } // End namespaces iostreams, boost. #endif // #ifndef BOOST_IOSTREAMS_ARRAY_HPP_INCLUDED
array.hpp
网页地址
文件地址
上一页 1/6
下一页
下载
( 5 KB )
Comments
Total ratings:
0
Average rating:
无评论
of 10
Would you like to comment?
Join now
, or
Logon
if you are already a member.