aboutsummaryrefslogtreecommitdiff
path: root/include/clang/Lex/HeaderMap.h
blob: ffc665094e4d1ada417189fdad532271d5f87001 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
//===--- HeaderMap.h - A file that acts like dir of symlinks ----*- C++ -*-===//
//
//                     The LLVM Compiler Infrastructure
//
// This file was developed by Chris Lattner and is distributed under
// the University of Illinois Open Source License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file defines the HeaderMap interface.
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_CLANG_LEX_HEADERMAP_H
#define LLVM_CLANG_LEX_HEADERMAP_H

#include <string>

namespace clang {
  class FileEntry;
  class FileManager;

/// This class represents an Apple concept known as a 'header map'.  To the
/// #include file resolution process, it basically acts like a directory of
/// symlinks to files.  Its advantages are that it is dense and more efficient
/// to create and process than a directory of symlinks.
class HeaderMap {
public:
  /// HeaderMap::Create - This attempts to load the specified file as a header
  /// map.  If it doesn't look like a HeaderMap, it gives up and returns null.
  /// If it looks like a HeaderMap but is obviously corrupted, it puts a reason
  /// into the string error argument and returns null.
  static const HeaderMap *Create(const FileEntry *FE, std::string &ErrorInfo) { 
    // FIXME: woot!
    return 0; 
  }
  
  /// LookupFile - Check to see if the specified relative filename is located in
  /// this HeaderMap.  If so, open it and return its FileEntry.
  const FileEntry *LookupFile(const char *FilenameStart,const char *FilenameEnd,
                              FileManager &FM) const {
    // FIXME: this needs work.
    return 0;
  }
    
};

} // end namespace clang.

#endif