/usr/include/boost/beast/_experimental/unit_test
NameSizeModeActions
detail/-0755rm
amount.hpp12010644editdlrm
dstream.hpp26450644editdlrm
global_suites.hpp11240644editdlrm
main.ipp22640644editdlrm
match.hpp37870644editdlrm
recorder.hpp17790644editdlrm
reporter.hpp60570644editdlrm
results.hpp50170644editdlrm
runner.hpp60750644editdlrm
suite.hpp154010644editdlrm
suite_info.hpp25210644editdlrm
suite_list.hpp18930644editdlrm
Edit: /usr/include/boost/beast/_experimental/unit_test/dstream.hpp (2645B)
// // Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com) // // 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) // // Official repository: https://github.com/boostorg/beast // #ifndef BOOST_BEAST_UNIT_TEST_DSTREAM_HPP #define BOOST_BEAST_UNIT_TEST_DSTREAM_HPP #include #include #include #include #include #include #include #ifdef BOOST_WINDOWS #include #include #endif namespace boost { namespace beast { namespace unit_test { #ifdef BOOST_WINDOWS namespace detail { template class dstream_buf : public std::basic_stringbuf { using ostream = std::basic_ostream; ostream& os_; bool dbg_; template void write(T const*) = delete; void write(char const* s) { if(dbg_) boost::winapi::OutputDebugStringA(s); os_ << s; } void write(wchar_t const* s) { if(dbg_) boost::winapi::OutputDebugStringW(s); os_ << s; } public: explicit dstream_buf(ostream& os) : os_(os) , dbg_(boost::winapi::IsDebuggerPresent() != 0) { } ~dstream_buf() { sync(); } int sync() override { write(this->str().c_str()); this->str(""); return 0; } }; } // detail /** std::ostream with Visual Studio IDE redirection. Instances of this stream wrap a specified `std::ostream` (such as `std::cout` or `std::cerr`). If the IDE debugger is attached when the stream is created, output will be additionally copied to the Visual Studio Output window. */ template< class CharT, class Traits = std::char_traits, class Allocator = std::allocator > class basic_dstream : public std::basic_ostream { detail::dstream_buf< CharT, Traits, Allocator> buf_; public: /** Construct a stream. @param os The output stream to wrap. */ explicit basic_dstream(std::ostream& os) : std::basic_ostream(&buf_) , buf_(os) { if(os.flags() & std::ios::unitbuf) std::unitbuf(*this); } }; using dstream = basic_dstream; using dwstream = basic_dstream; #else using dstream = std::ostream&; using dwstream = std::wostream&; #endif } // unit_test } // beast } // boost #endif