You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
661 B
28 lines
661 B
#ifndef FUZZTEST_COMMON_TEMP_DIR_H_
|
|
#define FUZZTEST_COMMON_TEMP_DIR_H_
|
|
|
|
#include <filesystem> // NOLINT
|
|
|
|
#include "absl/strings/string_view.h"
|
|
|
|
namespace fuzztest::internal {
|
|
|
|
// A helper class for creating a temporary directory. Removes the directory
|
|
// when it goes out of scope.
|
|
class TempDir {
|
|
public:
|
|
explicit TempDir(absl::string_view custom_prefix = "");
|
|
~TempDir();
|
|
|
|
TempDir(const TempDir& other) = delete;
|
|
TempDir& operator=(const TempDir& other) = delete;
|
|
|
|
const std::filesystem::path& path() const { return path_; }
|
|
|
|
private:
|
|
std::filesystem::path path_;
|
|
};
|
|
|
|
} // namespace fuzztest::internal
|
|
|
|
#endif // FUZZTEST_COMMON_TEMP_DIR_H_
|
|
|