MCPcopy Create free account
hub / github.com/KTH-RPL/dufomap / get_standard_stream

Function get_standard_stream

src/indicators.hpp:834–843  ·  view source on GitHub ↗

Since C++ hasn't a true way to extract stream handler from the a given `std::ostream` object, I have to write this kind of hack.

Source from the content-addressed store, hash-verified

832 //! from the a given `std::ostream` object, I have to write
833 //! this kind of hack.
834 inline
835 FILE* get_standard_stream(const std::ostream& stream)
836 {
837 if (&stream == &std::cout)
838 return stdout;
839 else if ((&stream == &std::cerr) || (&stream == &std::clog))
840 return stderr;
841
842 return nullptr;
843 }
844
845 // Say whether a given stream should be colorized or not. It's always
846 // true for ATTY streams and may be true for streams marked with

Callers 1

is_attyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected