Remove more uses of sys::Path.
[oota-llvm.git] / tools / llvm-ar / Archive.h
index 469a3b45f0d6fd4c61cafe21d178ce2420bdb7e5..79933ef1b897ebdf5b7d32431eed7cdf4e2ef914 100644 (file)
@@ -152,7 +152,7 @@ class ArchiveMember : public ilist_node<ArchiveMember> {
     /// be readable on entry to this method.
     /// @returns true if an error occurred, false otherwise
     /// @brief Replace contents of archive member with a new file.
-    bool replaceWith(const sys::Path &aFile, std::string* ErrMsg);
+    bool replaceWith(StringRef aFile, std::string* ErrMsg);
 
   /// @}
   /// @name Data
@@ -266,10 +266,10 @@ class Archive {
     /// the returned Archive object has at that time.
     /// @returns An Archive* that represents the new archive file.
     /// @brief Create an empty Archive.
-    static ArchiveCreateEmpty(
-      const sys::Path& Filename,///< Name of the archive to (eventually) create.
-      LLVMContext& C            ///< Context to use for global information
-    );
+    static Archive *CreateEmpty(
+        StringRef Filename, ///< Name of the archive to (eventually) create.
+        LLVMContext &C      ///< Context to use for global information
+        );
 
     /// Open an existing archive and load its contents in preparation for
     /// editing. After this call, the member ilist is completely populated based
@@ -277,11 +277,11 @@ class Archive {
     /// you intend to modify the archive or traverse its contents (e.g. for
     /// printing).
     /// @brief Open and load an archive file
-    static ArchiveOpenAndLoad(
-      const sys::Path& filePath,  ///< The file path to open and load
-      LLVMContext& C,       ///< The context to use for global information
-      std::string* ErrorMessage   ///< An optional error string
-    );
+    static Archive *OpenAndLoad(
+        StringRef filePath,       ///< The file path to open and load
+        LLVMContext &C,           ///< The context to use for global information
+        std::string *ErrorMessage ///< An optional error string
+        );
 
     /// This destructor cleans up the Archive object, releases all memory, and
     /// closes files. It does nothing with the archive file on disk. If you
@@ -296,7 +296,7 @@ class Archive {
   public:
     /// @returns the path to the archive file.
     /// @brief Get the archive path.
-    const sys::Path& getPath() { return archPath; }
+    StringRef getPath() { return archPath; }
 
     /// This method is provided so that editing methods can be invoked directly
     /// on the Archive's iplist of ArchiveMember. However, it is recommended
@@ -405,11 +405,10 @@ class Archive {
     /// given by \p where.
     /// @returns true if an error occurred, false otherwise
     /// @brief Add a file to the archive.
-    bool addFileBefore(
-      const sys::Path& filename, ///< The file to be added
-      iterator where,            ///< Insertion point
-      std::string* ErrMsg        ///< Optional error message location
-    );
+    bool addFileBefore(StringRef filename, ///< The file to be added
+                       iterator where,     ///< Insertion point
+                       std::string *ErrMsg ///< Optional error message location
+                       );
 
   /// @}
   /// @name Implementation
@@ -417,7 +416,7 @@ class Archive {
   protected:
     /// @brief Construct an Archive for \p filename and optionally  map it
     /// into memory.
-    explicit Archive(const sys::Path& filename, LLVMContext& C);
+    explicit Archive(StringRef filename, LLVMContext& C);
 
     /// @returns A fully populated ArchiveMember or 0 if an error occurred.
     /// @brief Parse the header of a member starting at \p At
@@ -477,7 +476,7 @@ class Archive {
   /// @name Data
   /// @{
   protected:
-    sys::Path archPath;       ///< Path to the archive file we read/write
+    std::string archPath;     ///< Path to the archive file we read/write
     MembersList members;      ///< The ilist of ArchiveMember
     MemoryBuffer *mapfile;    ///< Raw Archive contents mapped into memory
     const char* base;         ///< Base of the memory mapped file data