A utility class for maintaining a mapping from a file index to a file name. Also can be used for maintaining a mapping from a file index to a contents of a source text file represented as a SourceFile .
When a parsing function needs a file map parameter, you can give a default-constructed file map as an argument. The parsing function will add the file name and file contents to the file map.
public | FileMap() |
public void | AddSourceFile(int fileIndex, String<uchar>&& content, List<int>&& lineStartIndeces) |
public const List<String<char>>& | FileNames() const |
public const String<char>& | GetFileName(int fileIndex) const |
public Result<SourceFile*> | GetOrReadSourceFile(int fileIndex) const |
public SourceFile* | GetSourceFile(int fileIndex) const |
public bool | HasFileName(int fileIndex) const |
public int | MapFileName(const String<char>& fileName) |
private List<String<char>> | fileNames |
private Map<int, SourceFile, Less<int>> | sourceFileMap |