Line data Source code
1 : //===- ArchiveWriter.h - ar archive file format writer ----------*- C++ -*-===//
2 : //
3 : // The LLVM Compiler Infrastructure
4 : //
5 : // This file is distributed under the University of Illinois Open Source
6 : // License. See LICENSE.TXT for details.
7 : //
8 : //===----------------------------------------------------------------------===//
9 : //
10 : // Declares the writeArchive function for writing an archive file.
11 : //
12 : //===----------------------------------------------------------------------===//
13 :
14 : #ifndef LLVM_OBJECT_ARCHIVEWRITER_H
15 : #define LLVM_OBJECT_ARCHIVEWRITER_H
16 :
17 : #include "llvm/ADT/StringRef.h"
18 : #include "llvm/Object/Archive.h"
19 : #include "llvm/Support/Error.h"
20 : #include "llvm/Support/FileSystem.h"
21 :
22 : namespace llvm {
23 :
24 6943 : struct NewArchiveMember {
25 : std::unique_ptr<MemoryBuffer> Buf;
26 : StringRef MemberName;
27 : sys::TimePoint<std::chrono::seconds> ModTime;
28 : unsigned UID = 0, GID = 0, Perms = 0644;
29 :
30 : bool IsNew = false;
31 277 : NewArchiveMember() = default;
32 : NewArchiveMember(MemoryBufferRef BufRef);
33 :
34 : static Expected<NewArchiveMember>
35 : getOldMember(const object::Archive::Child &OldMember, bool Deterministic);
36 :
37 : static Expected<NewArchiveMember> getFile(StringRef FileName,
38 : bool Deterministic);
39 : };
40 :
41 : Error writeArchive(StringRef ArcName, ArrayRef<NewArchiveMember> NewMembers,
42 : bool WriteSymtab, object::Archive::Kind Kind,
43 : bool Deterministic, bool Thin,
44 : std::unique_ptr<MemoryBuffer> OldArchiveBuf = nullptr);
45 : }
46 :
47 : #endif
|