2015-06-08 04:32:01 +02:00
|
|
|
//===- ArchiveWriter.h - ar archive file format writer ----------*- C++ -*-===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// Declares the writeArchive function for writing an archive file.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef LLVM_OBJECT_ARCHIVEWRITER_H
|
|
|
|
#define LLVM_OBJECT_ARCHIVEWRITER_H
|
|
|
|
|
|
|
|
#include "llvm/ADT/StringRef.h"
|
|
|
|
#include "llvm/Object/Archive.h"
|
2017-09-22 01:13:36 +02:00
|
|
|
#include "llvm/Support/Error.h"
|
2015-06-08 04:32:01 +02:00
|
|
|
#include "llvm/Support/FileSystem.h"
|
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
|
2016-06-30 00:27:42 +02:00
|
|
|
struct NewArchiveMember {
|
|
|
|
std::unique_ptr<MemoryBuffer> Buf;
|
2017-06-12 21:45:35 +02:00
|
|
|
StringRef MemberName;
|
2016-10-24 15:38:27 +02:00
|
|
|
sys::TimePoint<std::chrono::seconds> ModTime;
|
2016-06-30 00:27:42 +02:00
|
|
|
unsigned UID = 0, GID = 0, Perms = 0644;
|
2015-06-08 04:32:01 +02:00
|
|
|
|
2016-11-30 23:32:58 +01:00
|
|
|
bool IsNew = false;
|
2016-06-30 00:27:42 +02:00
|
|
|
NewArchiveMember() = default;
|
|
|
|
NewArchiveMember(MemoryBufferRef BufRef);
|
2015-07-09 00:41:41 +02:00
|
|
|
|
2016-06-30 00:27:42 +02:00
|
|
|
static Expected<NewArchiveMember>
|
|
|
|
getOldMember(const object::Archive::Child &OldMember, bool Deterministic);
|
2015-06-08 04:32:01 +02:00
|
|
|
|
2016-06-30 00:27:42 +02:00
|
|
|
static Expected<NewArchiveMember> getFile(StringRef FileName,
|
|
|
|
bool Deterministic);
|
2015-06-08 04:32:01 +02:00
|
|
|
};
|
|
|
|
|
2017-09-22 01:13:36 +02:00
|
|
|
Error writeArchive(StringRef ArcName, ArrayRef<NewArchiveMember> NewMembers,
|
|
|
|
bool WriteSymtab, object::Archive::Kind Kind,
|
|
|
|
bool Deterministic, bool Thin,
|
|
|
|
std::unique_ptr<MemoryBuffer> OldArchiveBuf = nullptr);
|
2015-06-23 11:49:53 +02:00
|
|
|
}
|
2015-06-08 04:32:01 +02:00
|
|
|
|
|
|
|
#endif
|