58  memcpy(Hdr.
Magic, 
"ustar", 5); 
 
 
   71  int Len = 
Key.size() + Val.
size() + 3; 
 
 
   95  for (
size_t I = 0; 
I < 
sizeof(Hdr); ++
I)
 
   96    Chksum += 
reinterpret_cast<uint8_t *
>(&Hdr)[
I];
 
 
  104  std::string PaxAttr = 
formatPax(
"path", Path);
 
  108  snprintf(Hdr.
Size, 
sizeof(Hdr.
Size), 
"%011zo", PaxAttr.size());
 
  113  OS << StringRef(reinterpret_cast<char *>(&Hdr), 
sizeof(Hdr));
 
 
  143  const int MaxPrefix = 137;
 
  144  size_t Sep = Path.rfind(
'/', MaxPrefix + 1);
 
  150  Prefix = Path.substr(0, Sep);
 
  151  Name = Path.substr(Sep + 1);
 
 
  160  memcpy(Hdr.
Name, Name.data(), Name.size());
 
  161  memcpy(Hdr.
Mode, 
"0000664", 8);
 
  163  memcpy(Hdr.
Prefix, Prefix.data(), Prefix.size());
 
  165  OS << StringRef(reinterpret_cast<char *>(&Hdr), 
sizeof(Hdr));
 
 
  173  if (std::error_code EC =
 
  174          openFileForWrite(OutputPath, FD, CD_CreateAlways, OF_None))
 
  176  return std::unique_ptr<TarWriter>(
new TarWriter(FD, BaseDir));
 
 
  179TarWriter::TarWriter(
int FD, 
StringRef BaseDir)
 
  181      BaseDir(
std::string(BaseDir)) {}
 
  189  if (!Files.insert(Fullpath).second)
 
 
static void writePaxHeader(raw_fd_ostream &OS, StringRef Path)
 
static void writeUstarHeader(raw_fd_ostream &OS, StringRef Prefix, StringRef Name, size_t Size)
 
static void pad(raw_fd_ostream &OS)
 
static std::string formatPax(StringRef Key, StringRef Val)
 
static UstarHeader makeUstarHeader()
 
static const int BlockSize
 
static void computeChecksum(UstarHeader &Hdr)
 
static bool splitUstar(StringRef Path, StringRef &Prefix, StringRef &Name)
 
Tagged union holding either a T or a Error.
 
StringRef - Represent a constant reference to a string, i.e.
 
static constexpr size_t npos
 
constexpr size_t size() const
size - Get the string size.
 
static LLVM_ABI Expected< std::unique_ptr< TarWriter > > create(StringRef OutputPath, StringRef BaseDir)
 
LLVM_ABI void append(StringRef Path, StringRef Data)
 
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
 
LLVM_ABI std::string str() const
Return the twine contents as a std::string.
 
A raw_ostream that writes to a file descriptor.
 
uint64_t seek(uint64_t off)
Flushes the stream and repositions the underlying file descriptor position to the offset specified fr...
 
uint64_t tell() const
tell - Return the current offset with the file.
 
LLVM_ABI std::string convert_to_slash(StringRef path, Style style=Style::native)
Replaces backslashes with slashes if Windows.
 
This is an optimization pass for GlobalISel generic memory operations.
 
LLVM_ATTRIBUTE_VISIBILITY_DEFAULT AnalysisKey InnerAnalysisManagerProxy< AnalysisManagerT, IRUnitT, ExtraArgTs... >::Key
 
Error make_error(ArgTs &&... Args)
Make a Error instance representing failure using the given error info type.
 
FunctionAddr VTableAddr uintptr_t uintptr_t Data
 
uint64_t alignTo(uint64_t Size, Align A)
Returns a multiple of A needed to store Size bytes.
 
Implement std::hash so that hash_code can be used in STL containers.