21 #include <spot/misc/common.hh>
26 #include <spot/misc/formater.hh>
77 print(std::ostream& os,
const char*)
const final override
Open temporary file.
Definition: tmpfile.hh:95
void close()
Close the file descriptor.
SPOT_LOCAL open_temporary_file(char *name, cleanpos_t cp, int fd)
Build an open temporary file wrapper.
virtual ~open_temporary_file() override
Destroy the temporary file and close the descriptor.
int fd_
File descriptor.
Definition: tmpfile.hh:112
int fd() const
Return the file descriptor.
Definition: tmpfile.hh:106
Abstract base class for objects that can be printed to a stream via a format string.
Definition: formater.hh:35
Temporary file name.
Definition: tmpfile.hh:49
virtual ~temporary_file() override
Destroy the temporary file.
const char * name() const
Return the file name.
Definition: tmpfile.hh:63
std::list< temporary_file * >::iterator cleanpos_t
Iterator position in the cleanup list.
Definition: tmpfile.hh:52
friend std::ostream & operator<<(std::ostream &os, const temporary_file *f)
Stream the file name.
Definition: tmpfile.hh:69
SPOT_LOCAL temporary_file(char *name, cleanpos_t cp)
Build a temporary file wrapper.
cleanpos_t cleanpos_
Cleanup-list position.
Definition: tmpfile.hh:84
char * name_
File name.
Definition: tmpfile.hh:83
virtual void print(std::ostream &os, const char *) const final override
Print the file name.
Definition: tmpfile.hh:77
Definition: automata.hh:26
void cleanup_tmpfiles()
Delete all temporary files.
open_temporary_file * create_open_tmpfile(const char *prefix, const char *suffix=nullptr)
Create a temporary file and leave it open for writing.
temporary_file * create_tmpfile(const char *prefix, const char *suffix=nullptr)
Create a temporary file.