ArchiveWriter.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. #ifndef LLVM_OBJECT_ARCHIVEWRITER_H
  14. #define LLVM_OBJECT_ARCHIVEWRITER_H
  15. #include "llvm/ADT/StringRef.h"
  16. #include "llvm/Object/Archive.h"
  17. #include "llvm/Support/FileSystem.h"
  18. namespace llvm {
  19. class NewArchiveIterator {
  20. bool IsNewMember;
  21. StringRef Name;
  22. object::Archive::child_iterator OldI;
  23. StringRef NewFilename;
  24. public:
  25. NewArchiveIterator(object::Archive::child_iterator I, StringRef Name);
  26. NewArchiveIterator(StringRef I, StringRef Name);
  27. bool isNewMember() const;
  28. StringRef getName() const;
  29. object::Archive::child_iterator getOld() const;
  30. StringRef getNew() const;
  31. llvm::ErrorOr<int> getFD(sys::fs::file_status &NewStatus) const;
  32. const sys::fs::file_status &getStatus() const;
  33. };
  34. std::pair<StringRef, std::error_code>
  35. writeArchive(StringRef ArcName, std::vector<NewArchiveIterator> &NewMembers,
  36. bool WriteSymtab, object::Archive::Kind Kind, bool Deterministic);
  37. }
  38. #endif