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.
| 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 |