1351278Sdim//===- InjectedSourceStream.h - PDB Headerblock Stream Access ---*- C++ -*-===//
2351278Sdim//
3351278Sdim// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4351278Sdim// See https://llvm.org/LICENSE.txt for license information.
5351278Sdim// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6351278Sdim//
7351278Sdim//===----------------------------------------------------------------------===//
8351278Sdim
9351278Sdim#ifndef LLVM_DEBUGINFO_PDB_RAW_PDBINJECTEDSOURCESTREAM_H
10351278Sdim#define LLVM_DEBUGINFO_PDB_RAW_PDBINJECTEDSOURCESTREAM_H
11351278Sdim
12351278Sdim#include "llvm/DebugInfo/PDB/Native/HashTable.h"
13351278Sdim#include "llvm/DebugInfo/PDB/Native/RawTypes.h"
14351278Sdim#include "llvm/Support/Error.h"
15351278Sdim
16351278Sdimnamespace llvm {
17351278Sdimnamespace msf {
18351278Sdimclass MappedBlockStream;
19351278Sdim}
20351278Sdimnamespace pdb {
21351278Sdimclass PDBFile;
22351278Sdimclass PDBStringTable;
23351278Sdim
24351278Sdimclass InjectedSourceStream {
25351278Sdimpublic:
26351278Sdim  InjectedSourceStream(std::unique_ptr<msf::MappedBlockStream> Stream);
27351278Sdim  Error reload(const PDBStringTable &Strings);
28351278Sdim
29351278Sdim  using const_iterator = HashTable<SrcHeaderBlockEntry>::const_iterator;
30351278Sdim  const_iterator begin() const { return InjectedSourceTable.begin(); }
31351278Sdim  const_iterator end() const { return InjectedSourceTable.end(); }
32351278Sdim
33351278Sdim  uint32_t size() const { return InjectedSourceTable.size(); }
34351278Sdim
35351278Sdimprivate:
36351278Sdim  std::unique_ptr<msf::MappedBlockStream> Stream;
37351278Sdim
38351278Sdim  const SrcHeaderBlockHeader* Header;
39351278Sdim  HashTable<SrcHeaderBlockEntry> InjectedSourceTable;
40351278Sdim};
41351278Sdim}
42351278Sdim}
43351278Sdim
44351278Sdim#endif
45