llvm.org GIT mirror llvm / d79637b
raw_ostream: Add a has_colors() method. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160558 91177308-0d34-0410-b5e6-96231b3b80d8 Daniel Dunbar 7 years ago
2 changed file(s) with 9 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
229229 /// rather than being put on a pipe or stored in a file.
230230 virtual bool is_displayed() const { return false; }
231231
232 /// This function determines if this stream is displayed and supports colors.
233 virtual bool has_colors() const { return is_displayed(); }
234
232235 //===--------------------------------------------------------------------===//
233236 // Subclass Interface
234237 //===--------------------------------------------------------------------===//
385388
386389 virtual bool is_displayed() const;
387390
391 virtual bool has_colors() const;
392
388393 /// has_error - Return the value of the flag in this raw_fd_ostream indicating
389394 /// whether an output error has been encountered.
390395 /// This doesn't implicitly flush any pending output. Also, it doesn't
650650 return sys::Process::FileDescriptorIsDisplayed(FD);
651651 }
652652
653 bool raw_fd_ostream::has_colors() const {
654 return sys::Process::FileDescriptorHasColors(FD);
655 }
656
653657 //===----------------------------------------------------------------------===//
654658 // outs(), errs(), nulls()
655659 //===----------------------------------------------------------------------===//