M
mathieu
Hi there,
I am trying to implement a cross platform way of printing colored
strings (tty on unix and CONSOLE_SCREEN_BUFFER_INFO on win32). As far
as I understand there is no way to find out if a C++ stream is
attached to a tty, correct ?
Can I do something like that instead:
int detect(std::istream &is)
{
if( &is == &cout ) return fileno(stdout);
...
}
Thanks
-Mathieu
I am trying to implement a cross platform way of printing colored
strings (tty on unix and CONSOLE_SCREEN_BUFFER_INFO on win32). As far
as I understand there is no way to find out if a C++ stream is
attached to a tty, correct ?
Can I do something like that instead:
int detect(std::istream &is)
{
if( &is == &cout ) return fileno(stdout);
...
}
Thanks
-Mathieu