1 //===- ArchiveWriter.h - ar archive file format writer ----------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // Declares the writeArchive function for writing an archive file.
12 //===----------------------------------------------------------------------===//
14 #ifndef LLVM_OBJECT_ARCHIVEWRITER_H
15 #define LLVM_OBJECT_ARCHIVEWRITER_H
17 #include "llvm/ADT/StringRef.h"
18 #include "llvm/Object/Archive.h"
19 #include "llvm/Support/FileSystem.h"
23 class NewArchiveIterator {
27 object::Archive::Child OldMember;
30 NewArchiveIterator(const object::Archive::Child &OldMember, StringRef Name);
31 NewArchiveIterator(StringRef FileName);
32 bool isNewMember() const;
33 StringRef getName() const;
35 const object::Archive::Child &getOld() const;
37 StringRef getNew() const;
38 llvm::ErrorOr<int> getFD(sys::fs::file_status &NewStatus) const;
39 const sys::fs::file_status &getStatus() const;
42 std::pair<StringRef, std::error_code>
43 writeArchive(StringRef ArcName, std::vector<NewArchiveIterator> &NewMembers,
44 bool WriteSymtab, object::Archive::Kind Kind, bool Deterministic,