#ifndef SANDBOX_LINUX_TESTS_SCOPED_TEMPORARY_FILE_H_
#define SANDBOX_LINUX_TESTS_SCOPED_TEMPORARY_FILE_H_
#include <string>
#include "build/build_config.h"
namespace sandbox {
#if BUILDFLAG(IS_ANDROID)
static const char kTempDirForTests[] = "/data/local/tmp/";
#else
static const char kTempDirForTests[] = "/tmp/";
#endif
class ScopedTemporaryFile {
public:
ScopedTemporaryFile();
ScopedTemporaryFile(const ScopedTemporaryFile&) = delete;
ScopedTemporaryFile& operator=(const ScopedTemporaryFile&) = delete;
~ScopedTemporaryFile();
int fd() const { return fd_; }
const char* full_file_name() const { return full_file_name_.c_str(); }
private:
int fd_ = -1;
std::string full_file_name_;
};
}
#endif