2017-01-06 03:29:48 +01:00
|
|
|
//===-- llvm/Support/TarWriter.h - Tar archive file creator -----*- C++ -*-===//
|
|
|
|
//
|
2019-01-19 09:50:56 +01:00
|
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
2017-01-06 03:29:48 +01:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2021-02-06 06:02:06 +01:00
|
|
|
#ifndef LLVM_SUPPORT_TARWRITER_H
|
|
|
|
#define LLVM_SUPPORT_TARWRITER_H
|
2017-01-06 03:29:48 +01:00
|
|
|
|
|
|
|
#include "llvm/ADT/StringRef.h"
|
2017-12-05 11:09:59 +01:00
|
|
|
#include "llvm/ADT/StringSet.h"
|
2017-01-06 03:29:48 +01:00
|
|
|
#include "llvm/Support/Error.h"
|
|
|
|
#include "llvm/Support/raw_ostream.h"
|
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
class TarWriter {
|
|
|
|
public:
|
|
|
|
static Expected<std::unique_ptr<TarWriter>> create(StringRef OutputPath,
|
|
|
|
StringRef BaseDir);
|
|
|
|
|
|
|
|
void append(StringRef Path, StringRef Data);
|
|
|
|
|
|
|
|
private:
|
|
|
|
TarWriter(int FD, StringRef BaseDir);
|
|
|
|
raw_fd_ostream OS;
|
|
|
|
std::string BaseDir;
|
2017-12-05 11:09:59 +01:00
|
|
|
StringSet<> Files;
|
2017-01-06 03:29:48 +01:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|