osrm-backend/unit_tests/common/temporary_file.hpp

17 lines
394 B
C++
Raw Normal View History

2017-06-25 16:13:52 -04:00
#ifndef UNIT_TESTS_TEMPORARY_FILE_HPP
#define UNIT_TESTS_TEMPORARY_FILE_HPP
#include <boost/filesystem.hpp>
struct TemporaryFile
{
TemporaryFile() : path(boost::filesystem::unique_path()) {}
2018-03-22 14:26:40 -04:00
TemporaryFile(const std::string &path) : path(path) {}
2017-06-25 16:13:52 -04:00
~TemporaryFile() { boost::filesystem::remove(path); }
boost::filesystem::path path;
};
#endif // UNIT_TESTS_TEMPORARY_FILE_HPP