LLVM API Documentation
#include <raw_ostream.h>
Public Types | |
| enum | Colors { BLACK = 0, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE, SAVEDCOLOR } |
Public Member Functions | |
| raw_ostream (bool unbuffered=false) | |
| virtual | ~raw_ostream () |
| uint64_t | tell () |
| tell - Return the current offset with the file. | |
| bool | has_error () const |
| void | clear_error () |
| void | SetBuffered () |
| void | SetBufferSize (size_t Size) |
| size_t | GetBufferSize () |
| void | SetUnbuffered () |
| size_t | GetNumBytesInBuffer () const |
| void | flush () |
| raw_ostream & | operator<< (char C) |
| raw_ostream & | operator<< (unsigned char C) |
| raw_ostream & | operator<< (signed char C) |
| raw_ostream & | operator<< (const StringRef &Str) |
| raw_ostream & | operator<< (const char *Str) |
| raw_ostream & | operator<< (const std::string &Str) |
| raw_ostream & | operator<< (unsigned long N) |
| raw_ostream & | operator<< (long N) |
| raw_ostream & | operator<< (unsigned long long N) |
| raw_ostream & | operator<< (long long N) |
| raw_ostream & | operator<< (const void *P) |
| raw_ostream & | operator<< (unsigned int N) |
| raw_ostream & | operator<< (int N) |
| raw_ostream & | operator<< (double N) |
| raw_ostream & | write_hex (unsigned long long N) |
| write_hex - Output | |
| raw_ostream & | write (unsigned char C) |
| raw_ostream & | write (const char *Ptr, size_t Size) |
| raw_ostream & | operator<< (const format_object_base &Fmt) |
| virtual raw_ostream & | changeColor (enum Colors colors, bool bold=false, bool bg=false) |
| virtual raw_ostream & | resetColor () |
Protected Member Functions | |
| void | SetBuffer (char *BufferStart, size_t Size) |
| virtual size_t | preferred_buffer_size () |
| void | error_detected () |
| const char * | getBufferStart () const |
Definition at line 33 of file raw_ostream.h.
Definition at line 71 of file raw_ostream.h.
| llvm::raw_ostream::raw_ostream | ( | bool | unbuffered = false |
) | [inline, explicit] |
Definition at line 83 of file raw_ostream.h.
| raw_ostream::~raw_ostream | ( | ) | [virtual] |
| uint64_t llvm::raw_ostream::tell | ( | ) | [inline] |
tell - Return the current offset with the file.
Definition at line 92 of file raw_ostream.h.
References GetNumBytesInBuffer().
Referenced by WriteFileData().
| bool llvm::raw_ostream::has_error | ( | ) | const [inline] |
has_error - Return the value of the flag in this raw_ostream indicating whether an output error has been encountered.
Definition at line 96 of file raw_ostream.h.
| void llvm::raw_ostream::clear_error | ( | ) | [inline] |
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, llvm_report_error is called to report the error. Use clear_error() after handling the error to avoid this behavior.
Definition at line 104 of file raw_ostream.h.
| void raw_ostream::SetBuffered | ( | ) |
SetBuffered - Set the stream to be buffered, with an automatically determined buffer size.
Definition at line 74 of file raw_ostream.cpp.
References preferred_buffer_size(), SetBufferSize(), and SetUnbuffered().
Referenced by write().
| void llvm::raw_ostream::SetBufferSize | ( | size_t | Size | ) | [inline] |
SetBufferSize - Set the stream to be buffered, using the specified buffer size.
Definition at line 118 of file raw_ostream.h.
References flush().
Referenced by SetBuffered(), and llvm::formatted_raw_ostream::setStream().
| size_t llvm::raw_ostream::GetBufferSize | ( | ) | [inline] |
Definition at line 123 of file raw_ostream.h.
References preferred_buffer_size().
Referenced by llvm::formatted_raw_ostream::setStream().
| void llvm::raw_ostream::SetUnbuffered | ( | ) | [inline] |
SetUnbuffered - Set the stream to be unbuffered. When unbuffered, the stream will flush after every write. This routine will also flush the buffer immediately when the stream is being set to unbuffered.
Definition at line 137 of file raw_ostream.h.
References flush().
Referenced by SetBuffered(), and llvm::formatted_raw_ostream::setStream().
| size_t llvm::raw_ostream::GetNumBytesInBuffer | ( | ) | const [inline] |
Definition at line 142 of file raw_ostream.h.
Referenced by llvm::formatted_raw_ostream::PadToColumn(), and tell().
| void llvm::raw_ostream::flush | ( | ) | [inline] |
Definition at line 150 of file raw_ostream.h.
Referenced by AddModuleTypesToPrinter(), llvm::raw_fd_ostream::changeColor(), llvm::raw_fd_ostream::close(), llvm::MCAssembler::Finish(), PrintCurStackTrace(), llvm::X86ATTAsmPrinter::printMachineInstruction(), llvm::raw_fd_ostream::resetColor(), llvm::raw_fd_ostream::seek(), SetBufferSize(), SetUnbuffered(), llvm::raw_string_ostream::str(), llvm::raw_svector_ostream::str(), llvm::WriteBitcodeToFile(), llvm::formatted_raw_ostream::~formatted_raw_ostream(), llvm::raw_fd_ostream::~raw_fd_ostream(), llvm::raw_null_ostream::~raw_null_ostream(), llvm::raw_os_ostream::~raw_os_ostream(), llvm::raw_string_ostream::~raw_string_ostream(), and llvm::raw_svector_ostream::~raw_svector_ostream().
| raw_ostream& llvm::raw_ostream::operator<< | ( | char | C | ) | [inline] |
| raw_ostream& llvm::raw_ostream::operator<< | ( | unsigned char | C | ) | [inline] |
| raw_ostream& llvm::raw_ostream::operator<< | ( | signed char | C | ) | [inline] |
| raw_ostream& llvm::raw_ostream::operator<< | ( | const StringRef & | Str | ) | [inline] |
Definition at line 176 of file raw_ostream.h.
References llvm::StringRef::data(), llvm::Intrinsic::memcpy, llvm::StringRef::size(), and write().
| raw_ostream& llvm::raw_ostream::operator<< | ( | const char * | Str | ) | [inline] |
| raw_ostream& llvm::raw_ostream::operator<< | ( | const std::string & | Str | ) | [inline] |
| raw_ostream & raw_ostream::operator<< | ( | unsigned long | N | ) |
| raw_ostream & raw_ostream::operator<< | ( | long | N | ) |
Definition at line 118 of file raw_ostream.cpp.
| raw_ostream & raw_ostream::operator<< | ( | unsigned long long | N | ) |
| raw_ostream & raw_ostream::operator<< | ( | long long | N | ) |
Definition at line 143 of file raw_ostream.cpp.
| raw_ostream & raw_ostream::operator<< | ( | const void * | P | ) |
| raw_ostream& llvm::raw_ostream::operator<< | ( | unsigned int | N | ) | [inline] |
Definition at line 209 of file raw_ostream.h.
| raw_ostream& llvm::raw_ostream::operator<< | ( | int | N | ) | [inline] |
Definition at line 214 of file raw_ostream.h.
| raw_ostream& llvm::raw_ostream::operator<< | ( | double | N | ) | [inline] |
| raw_ostream & raw_ostream::write_hex | ( | unsigned long long | N | ) |
write_hex - Output
Definition at line 152 of file raw_ostream.cpp.
References write().
Referenced by operator<<().
| raw_ostream & raw_ostream::write | ( | unsigned char | C | ) |
Definition at line 183 of file raw_ostream.cpp.
References BUILTIN_EXPECT, and SetBuffered().
Referenced by llvm::raw_fd_ostream::changeColor(), llvm::MachOWriter::doFinalization(), operator<<(), llvm::formatted_raw_ostream::PadToColumn(), llvm::AsmPrinter::printInlineAsm(), llvm::raw_fd_ostream::resetColor(), write(), write_hex(), and llvm::WriteBitcodeToFile().
| raw_ostream & raw_ostream::write | ( | const char * | Ptr, | |
| size_t | Size | |||
| ) |
Definition at line 203 of file raw_ostream.cpp.
References BUILTIN_EXPECT, SetBuffered(), and write().
| raw_ostream & raw_ostream::operator<< | ( | const format_object_base & | Fmt | ) |
Definition at line 252 of file raw_ostream.cpp.
References llvm::SmallVectorImpl< T >::data(), llvm::format_object_base::print(), llvm::SmallVectorImpl< T >::resize(), V, and write().
| virtual raw_ostream& llvm::raw_ostream::changeColor | ( | enum Colors | colors, | |
| bool | bold = false, |
|||
| bool | bg = false | |||
| ) | [inline, virtual] |
Changes the foreground color of text that will be output from this point forward.
| 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 |
Reimplemented in llvm::raw_fd_ostream.
Definition at line 240 of file raw_ostream.h.
| virtual raw_ostream& llvm::raw_ostream::resetColor | ( | ) | [inline, virtual] |
Resets the colors to terminal defaults. Call this when you are done outputting colored text, or before program exit.
Reimplemented in llvm::raw_fd_ostream.
Definition at line 245 of file raw_ostream.h.
| void llvm::raw_ostream::SetBuffer | ( | char * | BufferStart, | |
| size_t | Size | |||
| ) | [inline, protected] |
SetBuffer - Use the provided buffer as the raw_ostream buffer. This is intended for use only by subclasses which can arrange for the output to go directly into the desired output buffer, instead of being copied on each flush.
Definition at line 278 of file raw_ostream.h.
Referenced by llvm::raw_svector_ostream::raw_svector_ostream().
| size_t raw_ostream::preferred_buffer_size | ( | ) | [protected, virtual] |
preferred_buffer_size - Return an efficient buffer size for the underlying output mechanism.
Definition at line 69 of file raw_ostream.cpp.
Referenced by GetBufferSize(), and SetBuffered().
| void llvm::raw_ostream::error_detected | ( | ) | [inline, protected] |
error_detected - Set the flag indicating that an output error has been encountered.
Definition at line 288 of file raw_ostream.h.
Referenced by llvm::raw_fd_ostream::close(), llvm::raw_fd_ostream::seek(), and llvm::raw_fd_ostream::~raw_fd_ostream().
| const char* llvm::raw_ostream::getBufferStart | ( | ) | const [inline, protected] |
getBufferStart - Return the beginning of the current stream buffer, or 0 if the stream is unbuffered.
Definition at line 292 of file raw_ostream.h.
Referenced by llvm::formatted_raw_ostream::PadToColumn().