]> git.decadent.org.uk Git - videolink.git/blob - temp_file.hpp
Replaced auto_temp_file with temp_file, which handles creation as well as deletion.
[videolink.git] / temp_file.hpp
1 // Copyright 2005 Ben Hutchings <ben@decadentplace.org.uk>.
2 // See the file "COPYING" for licence details.
3
4 #ifndef INC_TEMP_FILE_HPP
5 #define INC_TEMP_FILE_HPP
6
7 #include <string>
8
9 class temp_file
10 {
11 public:
12     explicit temp_file(const std::string & base_name);
13     ~temp_file();
14
15     void close();
16
17     int get_fd() const { return fd_; }
18     const std::string & get_name() const { return name_; }
19
20 private:
21     int fd_;
22     std::string name_;
23 };
24
25 #endif // !INC_TEMP_FILE_HPP