libcryfs/tempfile/TempFile.h

28 lines
544 B
C
Raw Normal View History

2015-04-25 02:40:02 +02:00
#pragma once
2015-10-15 12:58:16 +02:00
#ifndef MESSMER_CPPUTILS_TEMPFILE_TEMPFILE_H_
#define MESSMER_CPPUTILS_TEMPFILE_TEMPFILE_H_
2015-04-25 02:40:02 +02:00
#include <boost/filesystem.hpp>
#include "../macros.h"
namespace cpputils {
2015-10-29 15:51:16 +01:00
class TempFile final {
2015-04-25 02:40:02 +02:00
public:
explicit TempFile(const boost::filesystem::path &path, bool create = true);
explicit TempFile(bool create = true);
2015-10-29 15:51:16 +01:00
~TempFile();
2015-04-25 02:40:02 +02:00
const boost::filesystem::path &path() const;
2015-10-23 12:17:09 +02:00
//TODO Test exists()
2015-10-23 12:15:51 +02:00
bool exists() const;
2015-04-25 02:40:02 +02:00
private:
const boost::filesystem::path _path;
DISALLOW_COPY_AND_ASSIGN(TempFile);
};
}
#endif