llvm.org GIT mirror llvm / 085b9c0
One more iteration here and a yet better way to solve it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84150 91177308-0d34-0410-b5e6-96231b3b80d8 Eric Christopher 10 years ago
1 changed file(s) with 13 addition(s) and 14 deletion(s). Raw diff Collapse all Expand all
5050 /// for a \see write_impl() call to handle the data which has been put into
5151 /// this buffer.
5252 char *OutBufStart, *OutBufEnd, *OutBufCur;
53
53
5454 enum BufferKind {
5555 Unbuffered = 0,
5656 InternalBuffer,
210210 return *this;
211211 }
212212
213 raw_ostream &operator<<(double N);
213 raw_ostream &operator<<(double N);
214214
215215 /// write_hex - Output \arg N in hexadecimal, without any prefix or padding.
216216 raw_ostream &write_hex(unsigned long long N);
223223
224224 /// indent - Insert 'NumSpaces' spaces.
225225 raw_ostream &indent(unsigned NumSpaces);
226
227
226
227
228228 /// Changes the foreground color of text that will be output from this point
229229 /// forward.
230230 /// @param colors ANSI color to use, the special SAVEDCOLOR can be used to
232232 /// @param bold bold/brighter text, default false
233233 /// @param bg if true change the background, default: change foreground
234234 /// @returns itself so it can be used within << invocations
235 virtual raw_ostream &changeColor(enum Colors, bool bold = false,
236 bool bg = false)
237 { (void)bold; (void)bg; return *this; }
235 virtual raw_ostream &changeColor(enum Colors, bool = false,
236 bool = false) { return *this; }
238237
239238 /// Resets the colors to terminal defaults. Call this when you are done
240239 /// outputting colored text, or before program exit.
253252 /// write_impl - The is the piece of the class that is implemented
254253 /// by subclasses. This writes the \args Size bytes starting at
255254 /// \arg Ptr to the underlying stream.
256 ///
255 ///
257256 /// This function is guaranteed to only be called at a point at which it is
258257 /// safe for the subclass to install a new buffer via SetBuffer.
259258 ///
331330 virtual size_t preferred_buffer_size();
332331
333332 public:
334
333
335334 enum {
336335 /// F_Excl - When opening a file, this flag makes raw_fd_ostream
337336 /// report an error if the file already exists.
346345 /// make this distinction.
347346 F_Binary = 4
348347 };
349
348
350349 /// raw_fd_ostream - Open the specified file for writing. If an error occurs,
351350 /// information about the error is put into ErrorInfo, and the stream should
352351 /// be immediately destroyed; the string will be empty if no error occurred.
359358
360359 /// raw_fd_ostream ctor - FD is the file descriptor that this writes to. If
361360 /// ShouldClose is true, this closes the file when the stream is destroyed.
362 raw_fd_ostream(int fd, bool shouldClose,
363 bool unbuffered=false) : raw_ostream(unbuffered), FD(fd),
361 raw_fd_ostream(int fd, bool shouldClose,
362 bool unbuffered=false) : raw_ostream(unbuffered), FD(fd),
364363 ShouldClose(shouldClose) {}
365
364
366365 ~raw_fd_ostream();
367366
368367 /// close - Manually flush the stream and close the file.
465464 class raw_null_ostream : public raw_ostream {
466465 /// write_impl - See raw_ostream::write_impl.
467466 virtual void write_impl(const char *Ptr, size_t size);
468
467
469468 /// current_pos - Return the current position within the stream, not
470469 /// counting the bytes currently in the buffer.
471470 virtual uint64_t current_pos();