clang API Documentation

Public Types | Public Member Functions
clang::DirectoryLookup Class Reference

#include <DirectoryLookup.h>

Collaboration diagram for clang::DirectoryLookup:
Collaboration graph
[legend]

List of all members.

Public Types

enum  LookupType_t { LT_NormalDir, LT_Framework, LT_HeaderMap }

Public Member Functions

 DirectoryLookup (const DirectoryEntry *dir, SrcMgr::CharacteristicKind DT, bool isUser, bool isFramework)
 DirectoryLookup (const HeaderMap *map, SrcMgr::CharacteristicKind DT, bool isUser, bool isIndexHeaderMap)
LookupType_t getLookupType () const
const char * getName () const
const DirectoryEntrygetDir () const
const DirectoryEntrygetFrameworkDir () const
const HeaderMapgetHeaderMap () const
bool isNormalDir () const
 isNormalDir - Return true if this is a normal directory, not a header map.
bool isFramework () const
bool isHeaderMap () const
 isHeaderMap - Return true if this is a header map, not a normal directory.
SrcMgr::CharacteristicKind getDirCharacteristic () const
bool isUserSupplied () const
bool isIndexHeaderMap () const
 Whether this header map is building a framework or not.
const FileEntryLookupFile (StringRef Filename, HeaderSearch &HS, SmallVectorImpl< char > *SearchPath, SmallVectorImpl< char > *RelativePath, Module **SuggestedModule) const

Detailed Description

DirectoryLookup - This class represents one entry in the search list that specifies the search order for directories in #include directives. It represents either a directory, a framework, or a headermap.

Definition at line 31 of file DirectoryLookup.h.


Member Enumeration Documentation

Enumerator:
LT_NormalDir 
LT_Framework 
LT_HeaderMap 

Definition at line 33 of file DirectoryLookup.h.


Constructor & Destructor Documentation

clang::DirectoryLookup::DirectoryLookup ( const DirectoryEntry dir,
SrcMgr::CharacteristicKind  DT,
bool  isUser,
bool  isFramework 
) [inline]

DirectoryLookup ctor - Note that this ctor *does not take ownership* of 'dir'.

Definition at line 67 of file DirectoryLookup.h.

clang::DirectoryLookup::DirectoryLookup ( const HeaderMap map,
SrcMgr::CharacteristicKind  DT,
bool  isUser,
bool  isIndexHeaderMap 
) [inline]

DirectoryLookup ctor - Note that this ctor *does not take ownership* of 'map'.

Definition at line 77 of file DirectoryLookup.h.


Member Function Documentation

const DirectoryEntry* clang::DirectoryLookup::getDir ( ) const [inline]

getDir - Return the directory that this entry refers to.

Definition at line 94 of file DirectoryLookup.h.

References isNormalDir().

Referenced by getName(), LookupFile(), and RemoveDuplicates().

SrcMgr::CharacteristicKind clang::DirectoryLookup::getDirCharacteristic ( ) const [inline]

DirCharacteristic - The type of directory this is, one of the DirType enum values.

Definition at line 118 of file DirectoryLookup.h.

Referenced by clang::HeaderSearch::LookupFile(), and RemoveDuplicates().

const DirectoryEntry* clang::DirectoryLookup::getFrameworkDir ( ) const [inline]

getFrameworkDir - Return the directory that this framework refers to.

Definition at line 98 of file DirectoryLookup.h.

References isFramework().

Referenced by getName(), and RemoveDuplicates().

const HeaderMap* clang::DirectoryLookup::getHeaderMap ( ) const [inline]

getHeaderMap - Return the directory that this entry refers to.

Definition at line 104 of file DirectoryLookup.h.

References isHeaderMap().

Referenced by getName(), LookupFile(), and RemoveDuplicates().

LookupType_t clang::DirectoryLookup::getLookupType ( ) const [inline]

getLookupType - Return the kind of directory lookup that this is: either a normal directory, a framework path, or a HeaderMap.

Definition at line 86 of file DirectoryLookup.h.

Referenced by isFramework(), isHeaderMap(), isNormalDir(), and RemoveDuplicates().

const char * DirectoryLookup::getName ( ) const

getName - Return the directory or filename corresponding to this lookup object.

Definition at line 190 of file HeaderSearch.cpp.

References getDir(), clang::HeaderMap::getFileName(), getFrameworkDir(), getHeaderMap(), clang::DirectoryEntry::getName(), isFramework(), isHeaderMap(), and isNormalDir().

Referenced by LookupFile(), and RemoveDuplicates().

bool clang::DirectoryLookup::isFramework ( ) const [inline]

isFramework - True if this is a framework directory.

Definition at line 111 of file DirectoryLookup.h.

References getLookupType(), and LT_Framework.

Referenced by getFrameworkDir(), getName(), LookupFile(), and RemoveDuplicates().

bool clang::DirectoryLookup::isHeaderMap ( ) const [inline]

isHeaderMap - Return true if this is a header map, not a normal directory.

Definition at line 114 of file DirectoryLookup.h.

References getLookupType(), and LT_HeaderMap.

Referenced by getHeaderMap(), getName(), isIndexHeaderMap(), LookupFile(), and RemoveDuplicates().

bool clang::DirectoryLookup::isIndexHeaderMap ( ) const [inline]

Whether this header map is building a framework or not.

Definition at line 127 of file DirectoryLookup.h.

References isHeaderMap().

Referenced by clang::HeaderSearch::LookupFile().

bool clang::DirectoryLookup::isNormalDir ( ) const [inline]

isNormalDir - Return true if this is a normal directory, not a header map.

Definition at line 107 of file DirectoryLookup.h.

References getLookupType(), and LT_NormalDir.

Referenced by getDir(), getName(), LookupFile(), and RemoveDuplicates().

bool clang::DirectoryLookup::isUserSupplied ( ) const [inline]

isUserSupplied - True if this is a user-supplied directory.

Definition at line 124 of file DirectoryLookup.h.

const FileEntry * DirectoryLookup::LookupFile ( StringRef  Filename,
HeaderSearch HS,
SmallVectorImpl< char > *  SearchPath,
SmallVectorImpl< char > *  RelativePath,
Module **  SuggestedModule 
) const

LookupFile - Lookup the specified file in this search path, returning it if it exists or returning null if not.

Parameters:
FilenameThe file to look up relative to the search paths.
HSThe header search instance to search with.
SearchPathIf not NULL, will be set to the search path relative to which the file was found.
RelativePathIf not NULL, will be set to the path relative to SearchPath at which the file was found. This only differs from the Filename for framework includes.
SuggestedModuleIf non-null, and the file found is semantically part of a known module, this will be set to the module that should be imported instead of preprocessing/parsing the file found.

LookupFile - Lookup the specified file in this search path, returning it if it exists or returning null if not.

Definition at line 202 of file HeaderSearch.cpp.

References clang::HeaderSearch::findModuleForHeader(), getDir(), clang::FileManager::getFile(), clang::HeaderSearch::getFileMgr(), getHeaderMap(), clang::DirectoryEntry::getName(), getName(), clang::HeaderSearch::hasModuleMap(), isFramework(), isHeaderMap(), isNormalDir(), clang::HeaderMap::LookupFile(), and NULL.


Member Data Documentation

Dir - This is the actual directory that we're referring to for a normal directory or a framework.

Definition at line 42 of file DirectoryLookup.h.

Map - This is the HeaderMap if this is a headermap lookup.

Definition at line 46 of file DirectoryLookup.h.


The documentation for this class was generated from the following files: