HeaderMap.h revision 0f441ab20ccd8d21fd3d034de866bfcaf6cb72b2
1//===--- HeaderMap.h - A file that acts like dir of symlinks ----*- C++ -*-===//
2//
3//                     The LLVM Compiler Infrastructure
4//
5// This file was developed by Chris Lattner and is distributed under
6// the University of Illinois Open Source License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9//
10// This file defines the HeaderMap interface.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef LLVM_CLANG_LEX_HEADERMAP_H
15#define LLVM_CLANG_LEX_HEADERMAP_H
16
17#include <string>
18
19namespace clang {
20  class FileEntry;
21  class FileManager;
22
23/// This class represents an Apple concept known as a 'header map'.  To the
24/// #include file resolution process, it basically acts like a directory of
25/// symlinks to files.  Its advantages are that it is dense and more efficient
26/// to create and process than a directory of symlinks.
27class HeaderMap {
28  HeaderMap(const HeaderMap&); // DO NOT IMPLEMENT
29  void operator=(const HeaderMap&); // DO NOT IMPLEMENT
30public:
31  /// HeaderMap::Create - This attempts to load the specified file as a header
32  /// map.  If it doesn't look like a HeaderMap, it gives up and returns null.
33  /// If it looks like a HeaderMap but is obviously corrupted, it puts a reason
34  /// into the string error argument and returns null.
35  static const HeaderMap *Create(const FileEntry *FE, std::string &ErrorInfo);
36
37  /// LookupFile - Check to see if the specified relative filename is located in
38  /// this HeaderMap.  If so, open it and return its FileEntry.
39  const FileEntry *LookupFile(const char *FilenameStart,const char *FilenameEnd,
40                              FileManager &FM) const;
41
42};
43
44} // end namespace clang.
45
46#endif