cprover
Toggle main menu visibility
Loading...
Searching...
No Matches
output_file.h
Go to the documentation of this file.
1
/*******************************************************************\
2
3
Module: Output File Container
4
5
Author: Daniel Kroening, dkr@amazon.com
6
7
\*******************************************************************/
8
9
#ifndef CPROVER_UTIL_OUTPUT_FILE_H
10
#define CPROVER_UTIL_OUTPUT_FILE_H
11
14
15
#include <iosfwd>
16
#include <memory>
17
#include <string>
18
21
class
output_filet
final
22
{
23
public
:
26
explicit
output_filet
(std::string file_name);
27
~output_filet
();
28
29
std::ostream &
stream
()
30
{
31
return
*
_stream
;
32
}
33
35
const
std::string &
name
()
const
36
{
37
return
_name
;
38
}
39
41
bool
is_file
()
const
42
{
43
return
_ofstream
!=
nullptr
;
44
}
45
46
private
:
47
std::string
_name
;
48
std::unique_ptr<std::ofstream>
_ofstream
;
49
std::ostream *
_stream
=
nullptr
;
50
};
51
52
#endif
// CPROVER_UTIL_OUTPUT_FILE_H
output_filet::output_filet
output_filet(std::string file_name)
Create a stream to the given file name, or stdout if "-".
Definition
output_file.cpp:20
output_filet::_ofstream
std::unique_ptr< std::ofstream > _ofstream
Definition
output_file.h:48
output_filet::name
const std::string & name() const
The name of the file, or "stdout".
Definition
output_file.h:35
output_filet::is_file
bool is_file() const
True if the output is a file (not stdout).
Definition
output_file.h:41
output_filet::_name
std::string _name
Definition
output_file.h:47
output_filet::stream
std::ostream & stream()
Definition
output_file.h:29
output_filet::_stream
std::ostream * _stream
Definition
output_file.h:49
output_filet::~output_filet
~output_filet()
util
output_file.h
Generated by
1.17.0