mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-12-16 12:29:57 +00:00
Clear raw_fd_ostream error string on success and explain behavior in
documentation. Add C++ header marker. llvm-svn: 57923
This commit is contained in:
parent
c7d4f28254
commit
1ca20df437
@ -1,4 +1,4 @@
|
||||
//===--- raw_ostream.h - Raw output stream --------------------------------===//
|
||||
//===--- raw_ostream.h - Raw output stream ----------------------*- C++ -*-===//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
@ -152,9 +152,10 @@ class raw_fd_ostream : public raw_ostream {
|
||||
int FD;
|
||||
bool ShouldClose;
|
||||
public:
|
||||
/// 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.
|
||||
/// 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.
|
||||
raw_fd_ostream(const char *Filename, std::string &ErrorInfo);
|
||||
|
||||
/// raw_fd_ostream ctor - FD is the file descriptor that this writes to. If
|
||||
|
@ -196,10 +196,13 @@ void format_object_base::home() {
|
||||
// raw_fd_ostream
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
/// 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.
|
||||
/// 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.
|
||||
raw_fd_ostream::raw_fd_ostream(const char *Filename, std::string &ErrorInfo) {
|
||||
ErrorInfo.clear();
|
||||
|
||||
// Handle "-" as stdout.
|
||||
if (Filename[0] == '-' && Filename[1] == 0) {
|
||||
FD = STDOUT_FILENO;
|
||||
|
Loading…
Reference in New Issue
Block a user