#ifndef BASE_TEST_FILE_PATH_REPARSE_POINT_WIN_H_
#define BASE_TEST_FILE_PATH_REPARSE_POINT_WIN_H_
#include <optional>
#include "base/files/file_path.h"
#include "base/win/scoped_handle.h"
namespace base::test {
class FilePathReparsePoint {
public:
static std::optional<FilePathReparsePoint> Create(const FilePath& source,
const FilePath& target);
FilePathReparsePoint(const FilePathReparsePoint&) = delete;
FilePathReparsePoint& operator=(const FilePathReparsePoint&) = delete;
FilePathReparsePoint(FilePathReparsePoint&& other);
FilePathReparsePoint& operator=(FilePathReparsePoint&& other);
~FilePathReparsePoint();
private:
FilePathReparsePoint(const FilePath& source, const FilePath& target);
bool IsValid() const { return created_; }
bool SetReparsePoint(HANDLE source, const FilePath& target_path);
bool DeleteReparsePoint(HANDLE source);
win::ScopedHandle dir_;
bool created_;
};
}
#endif