1 //===- MCLDDirectory.h ----------------------------------------------------===// 2 // 3 // The MCLinker Project 4 // 5 // This file is distributed under the University of Illinois Open Source 6 // License. See LICENSE.TXT for details. 7 // 8 //===----------------------------------------------------------------------===// 9 #ifndef MCLD_MCLDDIRECTORY_H 10 #define MCLD_MCLDDIRECTORY_H 11 #ifdef ENABLE_UNITTEST 12 #include <gtest.h> 13 #endif 14 #include "mcld/Support/Directory.h" 15 #include "mcld/Support/FileSystem.h" 16 #include <llvm/ADT/StringRef.h> 17 #include <string> 18 19 namespace mcld 20 { 21 22 /** \class MCLDDirectory 23 * \brief MCLDDirectory is an directory entry for library search. 24 * 25 */ 26 class MCLDDirectory : public sys::fs::Directory 27 { 28 public: 29 MCLDDirectory(); 30 MCLDDirectory(const char* pName); 31 MCLDDirectory(const std::string& pName); 32 MCLDDirectory(llvm::StringRef pName); 33 virtual ~MCLDDirectory(); 34 35 public: 36 MCLDDirectory &assign(llvm::StringRef pName); 37 bool isInSysroot() const; 38 39 /// setSysroot - if MCLDDirectory is in sysroot, modify the path. 40 void setSysroot(const sys::fs::Path& pPath); 41 name()42 const std::string& name() const 43 { return m_Name; } 44 45 private: 46 std::string m_Name; 47 bool m_bInSysroot; 48 }; 49 50 } // namespace of mcld 51 52 #endif 53 54