LLVM API Documentation

llvm::raw_fd_ostream Class Reference

#include <raw_ostream.h>

Inheritance diagram for llvm::raw_fd_ostream:
[legend]
Collaboration diagram for llvm::raw_fd_ostream:
[legend]

List of all members.

Public Member Functions

 raw_fd_ostream (const char *Filename, bool Binary, bool Force, std::string &ErrorInfo)
 raw_fd_ostream (int fd, bool shouldClose, bool unbuffered=false)
 ~raw_fd_ostream ()
void close ()
 close - Manually flush the stream and close the file.
uint64_t seek (uint64_t off)
virtual raw_ostream & changeColor (enum Colors colors, bool bold=false, bool bg=false)
virtual raw_ostream & resetColor ()


Detailed Description

raw_fd_ostream - A raw_ostream that writes to a file descriptor.

Definition at line 317 of file raw_ostream.h.


Constructor & Destructor Documentation

raw_fd_ostream::raw_fd_ostream ( const char *  Filename,
bool  Binary,
bool  Force,
std::string &  ErrorInfo 
)

raw_fd_ostream - Open the specified file for writing. If an error occurs, information about the error is put into ErrorInfo, and the stream should be immediately destroyed; the string will be empty if no error occurred.

Parameters:
Filename - The file to open. If this is "-" then the stream will use stdout instead.
Binary - The file should be opened in binary mode on platforms that support this distinction.
Force - Don't consider the case where the file already exists to be an error.
raw_fd_ostream - Open the specified file for writing. If an error occurs, information about the error is put into ErrorInfo, and the stream should be immediately destroyed; the string will be empty if no error occurred.

Definition at line 308 of file raw_ostream.cpp.

References llvm::sys::Program::ChangeStdoutToBinary().

llvm::raw_fd_ostream::raw_fd_ostream ( int  fd,
bool  shouldClose,
bool  unbuffered = false 
) [inline]

raw_fd_ostream ctor - FD is the file descriptor that this writes to. If ShouldClose is true, this closes the file when the stream is destroyed.

Definition at line 349 of file raw_ostream.h.

raw_fd_ostream::~raw_fd_ostream (  ) 


Member Function Documentation

void raw_fd_ostream::close (  ) 

close - Manually flush the stream and close the file.

Definition at line 355 of file raw_ostream.cpp.

References llvm::raw_ostream::error_detected(), and llvm::raw_ostream::flush().

Referenced by ~raw_fd_ostream().

uint64_t raw_fd_ostream::seek ( uint64_t  off  ) 

seek - Flushes the stream and repositions the underlying file descriptor positition to the offset specified from the beginning of the file.

Definition at line 364 of file raw_ostream.cpp.

References llvm::raw_ostream::error_detected(), and llvm::raw_ostream::flush().

raw_ostream & raw_fd_ostream::changeColor ( enum Colors  colors,
bool  bold = false,
bool  bg = false 
) [virtual]

Changes the foreground color of text that will be output from this point forward.

Parameters:
colors ANSI color to use, the special SAVEDCOLOR can be used to change only the bold attribute, and keep colors untouched
bold bold/brighter text, default false
bg if true change the background, default: change foreground
Returns:
itself so it can be used within << invocations

Reimplemented from llvm::raw_ostream.

Definition at line 390 of file raw_ostream.cpp.

References llvm::sys::Process::ColorNeedsFlush(), llvm::raw_ostream::flush(), llvm::sys::Process::OutputBold(), llvm::sys::Process::OutputColor(), llvm::raw_ostream::SAVEDCOLOR, and llvm::raw_ostream::write().

raw_ostream & raw_fd_ostream::resetColor (  )  [virtual]

Resets the colors to terminal defaults. Call this when you are done outputting colored text, or before program exit.

Reimplemented from llvm::raw_ostream.

Definition at line 406 of file raw_ostream.cpp.

References llvm::sys::Process::ColorNeedsFlush(), llvm::raw_ostream::flush(), llvm::sys::Process::ResetColor(), and llvm::raw_ostream::write().


The documentation for this class was generated from the following files: