14#ifndef LLVM_SUPPORT_FILEUTILITIES_H
15#define LLVM_SUPPORT_FILEUTILITIES_H
21#include <system_error>
34 double AbsTol,
double RelTol,
35 std::string *Error =
nullptr);
49 : DeleteIt(deleteIt) {
50 filename.toVector(Filename);
70 filename.toVector(Filename);
91 std::optional<sys::fs::perms> OverwritePermissions = std::nullopt);
95 : InputFilename(InputFilename), InputStatus(
Status) {}
static cl::opt< std::string > OutputFilename("o", cl::desc("Output filename"), cl::value_desc("filename"), cl::init("-"))
Lightweight error class with error context and mandatory checking.
Tagged union holding either a T or a Error.
FilePermssionsApplier helps to copy permissions from an input file to an output one.
Error apply(StringRef OutputFilename, bool CopyDates=false, std::optional< sys::fs::perms > OverwritePermissions=std::nullopt)
Apply stored permissions to the OutputFilename.
static Expected< FilePermissionsApplier > create(StringRef InputFilename)
FileRemover - This class is a simple object meant to be stack allocated.
FileRemover(const Twine &filename, bool deleteIt=true)
void setFile(const Twine &filename, bool deleteIt=true)
setFile - Give ownership of the file to the FileRemover so it will be removed when the object is dest...
void releaseFile()
releaseFile - Take ownership of the file away from the FileRemover so it will not be removed when the...
SmallString - A SmallString is just a SmallVector with methods and accessors that make it work better...
StringRef - Represent a constant reference to a string, i.e.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
Represents the result of a call to sys::fs::status().
std::error_code remove(const Twine &path, bool IgnoreNonExisting=true)
Remove path.
This is an optimization pass for GlobalISel generic memory operations.
int DiffFilesWithTolerance(StringRef FileA, StringRef FileB, double AbsTol, double RelTol, std::string *Error=nullptr)
DiffFilesWithTolerance - Compare the two files specified, returning 0 if the files match,...