x
Yes
No
Do you want to visit DriveHQ English website?
首页
产品服务
价格
免费试用
下载客户端
关于我们
云文件服务
|
云备份服务
|
FTP服务
|
企业邮箱服务
|
网站托管
|
客户端软件
云文件服务
云备份服务
FTP服务
企业级邮箱服务
网站托管
客户端软件
wrap_stringstream.hpp - Hosted on DriveHQ Cloud IT Platform
返回上层目录
上传
下载
共享
发布
新建文件夹
新建文件
复制
剪切
删除
粘贴
评论
升级服务
路径: \\game3dprogramming\materials\GameFactory\GameFactoryDemo\references\boost_1_35_0\boost\test\utils\wrap_stringstream.hpp
旋转
特效
属性
历史版本
// (C) Copyright Gennadiy Rozental 2002-2007. // 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/test for the library home page. // // File : $RCSfile$ // // Version : $Revision: 41369 $ // // Description : wraps strstream and stringstream (depends with one is present) // to provide the unified interface // *************************************************************************** #ifndef BOOST_WRAP_STRINGSTREAM_HPP_071894GER #define BOOST_WRAP_STRINGSTREAM_HPP_071894GER // Boost.Test #include
// STL #ifdef BOOST_NO_STRINGSTREAM #include
// for std::ostrstream #else #include
// for std::ostringstream #endif // BOOST_NO_STRINGSTREAM #include
//____________________________________________________________________________// namespace boost { // ************************************************************************** // // ************** basic_wrap_stringstream ************** // // ************************************************************************** // template
class basic_wrap_stringstream { public: #if defined(BOOST_CLASSIC_IOSTREAMS) typedef std::ostringstream wrapped_stream; #elif defined(BOOST_NO_STRINGSTREAM) typedef std::basic_ostrstream
wrapped_stream; #else typedef std::basic_ostringstream
wrapped_stream; #endif // BOOST_NO_STRINGSTREAM // Access methods basic_wrap_stringstream& ref(); wrapped_stream& stream(); std::basic_string
const& str(); private: // Data members wrapped_stream m_stream; std::basic_string
m_str; }; //____________________________________________________________________________// template
inline basic_wrap_stringstream
& operator<<( basic_wrap_stringstream
& targ, T const& t ) { targ.stream() << t; return targ; } //____________________________________________________________________________// template
inline typename basic_wrap_stringstream
::wrapped_stream& basic_wrap_stringstream
::stream() { return m_stream; } //____________________________________________________________________________// template
inline basic_wrap_stringstream
& basic_wrap_stringstream
::ref() { return *this; } //____________________________________________________________________________// template
inline std::basic_string
const& basic_wrap_stringstream
::str() { #ifdef BOOST_NO_STRINGSTREAM m_str.assign( m_stream.str(), m_stream.pcount() ); m_stream.freeze( false ); #else m_str = m_stream.str(); #endif return m_str; } //____________________________________________________________________________// template
inline basic_wrap_stringstream
& operator<<( basic_wrap_stringstream
& targ, basic_wrap_stringstream
& src ) { targ << src.str(); return targ; } //____________________________________________________________________________// #if !defined(BOOST_NO_STD_LOCALE) && \ (!defined(BOOST_MSVC) || BOOST_WORKAROUND(BOOST_MSVC, >= 1310)) && \ !defined(__MWERKS__) && !BOOST_WORKAROUND(__GNUC__, < 3) template
inline basic_wrap_stringstream
& operator<<( basic_wrap_stringstream
& targ, std::ios_base& (BOOST_TEST_CALL_DECL *man)(std::ios_base&) ) { targ.stream() << man; return targ; } //____________________________________________________________________________// template
inline basic_wrap_stringstream
& operator<<( basic_wrap_stringstream
& targ, std::basic_ostream
& (BOOST_TEST_CALL_DECL *man)(std::basic_ostream
&) ) { targ.stream() << man; return targ; } //____________________________________________________________________________// template
inline basic_wrap_stringstream
& operator<<( basic_wrap_stringstream
& targ, std::basic_ios
& (BOOST_TEST_CALL_DECL *man)(std::basic_ios
&) ) { targ.stream() << man; return targ; } //____________________________________________________________________________// #endif // ************************************************************************** // // ************** wrap_stringstream ************** // // ************************************************************************** // typedef basic_wrap_stringstream
wrap_stringstream; typedef basic_wrap_stringstream
wrap_wstringstream; } // namespace boost //____________________________________________________________________________// #include
#endif // BOOST_WRAP_STRINGSTREAM_HPP_071894GER
wrap_stringstream.hpp
网页地址
文件地址
上一页
12/13
下一页
下载
( 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.