diff options
Diffstat (limited to 'include/llvm')
-rw-r--r-- | include/llvm/Support/raw_ostream.h | 7 | ||||
-rw-r--r-- | include/llvm/System/Process.h | 5 |
2 files changed, 12 insertions, 0 deletions
diff --git a/include/llvm/Support/raw_ostream.h b/include/llvm/Support/raw_ostream.h index a01d4cdb04..dbad40ca91 100644 --- a/include/llvm/Support/raw_ostream.h +++ b/include/llvm/Support/raw_ostream.h @@ -240,6 +240,11 @@ public: /// outputting colored text, or before program exit. virtual raw_ostream &resetColor() { return *this; } + /// This function determines if this stream is connected to a "tty" or + /// "console" window. That is, the output would be displayed to the user + /// rather than being put on a pipe or stored in a file. + virtual bool is_displayed() const { return false; } + //===--------------------------------------------------------------------===// // Subclass Interface //===--------------------------------------------------------------------===// @@ -370,6 +375,8 @@ public: virtual raw_ostream &changeColor(enum Colors colors, bool bold=false, bool bg=false); virtual raw_ostream &resetColor(); + + virtual bool is_displayed() const; }; /// raw_stdout_ostream - This is a stream that always prints to stdout. diff --git a/include/llvm/System/Process.h b/include/llvm/System/Process.h index 11dbf759a6..010499acd4 100644 --- a/include/llvm/System/Process.h +++ b/include/llvm/System/Process.h @@ -94,6 +94,11 @@ namespace sys { /// the user rather than being put on a pipe or stored in a file. static bool StandardErrIsDisplayed(); + /// This function determines if the given file descriptor is connected to + /// a "tty" or "console" window. That is, the output would be displayed to + /// the user rather than being put on a pipe or stored in a file. + static bool FileDescriptorIsDisplayed(int fd); + /// This function determines the number of columns in the window /// if standard output is connected to a "tty" or "console" /// window. If standard output is not connected to a tty or |