|
CBMC
|
RAII container for an output stream that is either stdout or a file. More...
#include <output_file.h>
Collaboration diagram for output_filet:Public Member Functions | |
| output_filet (std::string file_name) | |
| Create a stream to the given file name, or stdout if "-". | |
| ~output_filet () | |
| std::ostream & | stream () |
| const std::string & | name () const |
| The name of the file, or "stdout". | |
| bool | is_file () const |
| True if the output is a file (not stdout). | |
Private Attributes | |
| std::string | _name |
| std::unique_ptr< std::ofstream > | _ofstream |
| std::ostream * | _stream = nullptr |
RAII container for an output stream that is either stdout or a file.
Pass "-" as the file name to write to stdout.
Definition at line 21 of file output_file.h.
|
explicit |
Create a stream to the given file name, or stdout if "-".
Throws system_exceptiont if the file cannot be opened.
Definition at line 20 of file output_file.cpp.
|
default |
|
inline |
True if the output is a file (not stdout).
Definition at line 41 of file output_file.h.
|
inline |
The name of the file, or "stdout".
Definition at line 35 of file output_file.h.
|
inline |
Definition at line 29 of file output_file.h.
|
private |
Definition at line 47 of file output_file.h.
|
private |
Definition at line 48 of file output_file.h.
|
private |
Definition at line 49 of file output_file.h.