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_MC_MCLDDIRECTORY_H_
10 #define MCLD_MC_MCLDDIRECTORY_H_
11 #include "mcld/Support/Directory.h"
12 #include "mcld/Support/FileSystem.h"
13 
14 #include <llvm/ADT/StringRef.h>
15 
16 #include <string>
17 
18 namespace mcld {
19 
20 /** \class MCLDDirectory
21  *  \brief MCLDDirectory is an directory entry for library search.
22  *
23  */
24 class MCLDDirectory : public sys::fs::Directory {
25  public:
26   MCLDDirectory();
27   explicit MCLDDirectory(const char* pName);
28   explicit MCLDDirectory(const std::string& pName);
29   explicit MCLDDirectory(llvm::StringRef pName);
30   virtual ~MCLDDirectory();
31 
32  public:
33   MCLDDirectory& assign(llvm::StringRef pName);
34   bool isInSysroot() const;
35 
36   /// setSysroot - if MCLDDirectory is in sysroot, modify the path.
37   void setSysroot(const sys::fs::Path& pPath);
38 
name()39   const std::string& name() const { return m_Name; }
40 
41  private:
42   std::string m_Name;
43   bool m_bInSysroot;
44 };
45 
46 }  // namespace mcld
47 
48 #endif  // MCLD_MC_MCLDDIRECTORY_H_
49