+ /// close - Manually flush the stream and close the file.
+ /// Note that this does not call fsync.
+ void close();
+
+ /// seek - Flushes the stream and repositions the underlying file descriptor
+ /// position to the offset specified from the beginning of the file.
+ uint64_t seek(uint64_t off);
+
+ /// SetUseAtomicWrite - Set the stream to attempt to use atomic writes for
+ /// individual output routines where possible.
+ ///
+ /// Note that because raw_ostream's are typically buffered, this flag is only
+ /// sensible when used on unbuffered streams which will flush their output
+ /// immediately.
+ void SetUseAtomicWrites(bool Value) {
+ UseAtomicWrites = Value;
+ }
+
+ virtual raw_ostream &changeColor(enum Colors colors, bool bold=false,
+ bool bg=false);
+ virtual raw_ostream &resetColor();
+
+ virtual raw_ostream &reverseColor();
+
+ virtual bool is_displayed() const;
+
+ virtual bool has_colors() const;
+
+ /// has_error - Return the value of the flag in this raw_fd_ostream indicating
+ /// whether an output error has been encountered.
+ /// This doesn't implicitly flush any pending output. Also, it doesn't
+ /// guarantee to detect all errors unless the stream has been closed.
+ bool has_error() const {
+ return Error;
+ }
+
+ /// clear_error - Set the flag read by has_error() to false. If the error
+ /// flag is set at the time when this raw_ostream's destructor is called,
+ /// report_fatal_error is called to report the error. Use clear_error()
+ /// after handling the error to avoid this behavior.
+ ///
+ /// "Errors should never pass silently.
+ /// Unless explicitly silenced."
+ /// - from The Zen of Python, by Tim Peters
+ ///
+ void clear_error() {
+ Error = false;
+ }