Home | History | Annotate | Download | only in MC
      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 #include <llvm/ADT/StringRef.h>
     14 #include <string>
     15 
     16 namespace mcld
     17 {
     18 
     19 /** \class MCLDDirectory
     20  *  \brief MCLDDirectory is an directory entry for library search.
     21  *
     22  */
     23 class MCLDDirectory : public sys::fs::Directory
     24 {
     25 public:
     26   MCLDDirectory();
     27   MCLDDirectory(const char* pName);
     28   MCLDDirectory(const std::string& pName);
     29   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 
     39   const std::string& name() const
     40   { return m_Name; }
     41 
     42 private:
     43   std::string m_Name;
     44   bool m_bInSysroot;
     45 };
     46 
     47 } // namespace of mcld
     48 
     49 #endif
     50 
     51