CBMC
Toggle main menu visibility
Main Page
Related Pages
Namespaces
Namespace List
Namespace Members
All
a
c
d
e
f
g
j
l
m
r
t
w
Functions
a
c
d
f
g
r
t
w
Typedefs
Enumerations
Classes
Class List
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
Enumerations
a
b
c
d
e
f
g
i
k
l
m
o
p
r
s
t
u
v
w
Enumerator
a
b
c
d
e
f
h
i
k
l
m
n
o
p
q
r
s
t
u
v
Related Symbols
b
c
d
e
g
i
j
m
n
o
s
t
u
v
Files
File List
File Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
y
z
Variables
_
a
b
c
d
e
f
g
i
l
m
n
o
p
r
s
t
u
w
y
Typedefs
_
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
r
s
t
u
v
w
Enumerations
_
a
b
c
d
f
g
i
l
m
p
r
s
t
u
v
w
Enumerator
_
a
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
Macros
_
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
x
y
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Modules
Pages
Loading...
Searching...
No Matches
tempfile.h
Go to the documentation of this file.
1
/*******************************************************************\
2
3
Module:
4
5
Author: Daniel Kroening
6
7
\*******************************************************************/
8
9
10
#ifndef CPROVER_UTIL_TEMPFILE_H
11
#define CPROVER_UTIL_TEMPFILE_H
12
13
#include <string>
14
15
// Returns an unused file name for a writeable temporary file,
16
// and makes sure it exists.
17
std::string
get_temporary_file
(
18
const
std::string &prefix,
19
const
std::string &suffix);
20
21
// The below deletes the temporary file upon destruction,
22
// cleaning up after you in case of exceptions.
23
class
temporary_filet
24
{
25
public
:
26
temporary_filet
(
27
const
std::string &prefix,
28
const
std::string &suffix):
29
name
(
get_temporary_file
(prefix, suffix))
30
{
31
}
26
temporary_filet
( {
…
}
32
33
// Using the copy constructor would delete the file twice.
34
temporary_filet
(
const
temporary_filet
&)=
delete
;
35
36
temporary_filet
(
temporary_filet
&&other)
37
{
38
name
.swap(other.name);
39
}
36
temporary_filet
(
temporary_filet
&&other) {
…
}
40
41
// get the name
42
std::string
operator()
()
const
43
{
44
return
name
;
45
}
42
std::string
operator()
()
const
{
…
}
46
47
// will delete the file
48
~temporary_filet
();
49
50
protected
:
51
std::string
name
;
52
};
23
class
temporary_filet
{
…
};
53
54
#endif
// CPROVER_UTIL_TEMPFILE_H
temporary_filet
Definition
tempfile.h:24
temporary_filet::temporary_filet
temporary_filet(temporary_filet &&other)
Definition
tempfile.h:36
temporary_filet::temporary_filet
temporary_filet(const temporary_filet &)=delete
temporary_filet::name
std::string name
Definition
tempfile.h:51
temporary_filet::temporary_filet
temporary_filet(const std::string &prefix, const std::string &suffix)
Definition
tempfile.h:26
temporary_filet::operator()
std::string operator()() const
Definition
tempfile.h:42
temporary_filet::~temporary_filet
~temporary_filet()
Definition
tempfile.cpp:145
get_temporary_file
std::string get_temporary_file(const std::string &prefix, const std::string &suffix)
Substitute for mkstemps (OpenBSD standard) for Windows, where it is unavailable.
Definition
tempfile.cpp:99
src
util
tempfile.h
Generated by
1.9.8