Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC)
[oota-llvm.git] / include / llvm / Object / ArchiveWriter.h
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/FileSystem.h"
20
21 namespace llvm {
22
23 class NewArchiveIterator {
24   bool IsNewMember;
25   StringRef Name;
26
27   object::Archive::child_iterator OldI;
28
29   StringRef NewFilename;
30
31 public:
32   NewArchiveIterator(object::Archive::child_iterator I, StringRef Name);
33   NewArchiveIterator(StringRef I, StringRef Name);
34   NewArchiveIterator();
35   bool isNewMember() const;
36   StringRef getName() const;
37
38   object::Archive::child_iterator getOld() const;
39
40   StringRef getNew() const;
41   llvm::ErrorOr<int> getFD(sys::fs::file_status &NewStatus) const;
42   const sys::fs::file_status &getStatus() const;
43 };
44
45 std::pair<StringRef, std::error_code>
46 writeArchive(StringRef ArcName, std::vector<NewArchiveIterator> &NewMembers,
47              bool WriteSymtab);
48
49 }
50
51 #endif