/usr/include/boost/test/utils
NameSizeModeActions
basic_cstring/-0755rm
iterator/-0755rm
runtime/-0755rm
algorithm.hpp136710644editdlrm
assign_op.hpp10980644editdlrm
class_properties.hpp81640644editdlrm
custom_manip.hpp18980644editdlrm
foreach.hpp117940644editdlrm
is_cstring.hpp42940644editdlrm
is_forward_iterable.hpp84560644editdlrm
lazy_ostream.hpp47340644editdlrm
named_params.hpp145440644editdlrm
nullstream.hpp39900644editdlrm
rtti.hpp18450644editdlrm
setcolor.hpp93150644editdlrm
string_cast.hpp20020644editdlrm
timer.hpp50180644editdlrm
wrap_stringstream.hpp49050644editdlrm
xml_printer.hpp40510644editdlrm
Edit: /usr/include/boost/test/utils/wrap_stringstream.hpp (4905B)
// (C) Copyright Gennadiy Rozental 2001. // 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$ // // Description : wraps strstream and stringstream (depends with one is present) // to provide the unified interface // *************************************************************************** #ifndef BOOST_TEST_UTILS_WRAP_STRINGSTREAM_HPP #define BOOST_TEST_UTILS_WRAP_STRINGSTREAM_HPP // 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 BOOST_TEST_USE_STD_LOCALE 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_TEST_UTILS_WRAP_STRINGSTREAM_HPP