IPDBDataStream.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #pragma once
  2. #ifdef __GNUC__
  3. #pragma GCC diagnostic push
  4. #pragma GCC diagnostic ignored "-Wunused-parameter"
  5. #endif
  6. //===- IPDBDataStream.h - base interface for child enumerator ---*- C++ -*-===//
  7. //
  8. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  9. // See https://llvm.org/LICENSE.txt for license information.
  10. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  11. //
  12. //===----------------------------------------------------------------------===//
  13. #ifndef LLVM_DEBUGINFO_PDB_IPDBDATASTREAM_H
  14. #define LLVM_DEBUGINFO_PDB_IPDBDATASTREAM_H
  15. #include "llvm/ADT/SmallVector.h"
  16. #include <cstdint>
  17. #include <optional>
  18. #include <string>
  19. namespace llvm {
  20. namespace pdb {
  21. /// IPDBDataStream defines an interface used to represent a stream consisting
  22. /// of a name and a series of records whose formats depend on the particular
  23. /// stream type.
  24. class IPDBDataStream {
  25. public:
  26. using RecordType = SmallVector<uint8_t, 32>;
  27. virtual ~IPDBDataStream();
  28. virtual uint32_t getRecordCount() const = 0;
  29. virtual std::string getName() const = 0;
  30. virtual std::optional<RecordType> getItemAtIndex(uint32_t Index) const = 0;
  31. virtual bool getNext(RecordType &Record) = 0;
  32. virtual void reset() = 0;
  33. };
  34. } // end namespace pdb
  35. } // end namespace llvm
  36. #endif // LLVM_DEBUGINFO_PDB_IPDBDATASTREAM_H
  37. #ifdef __GNUC__
  38. #pragma GCC diagnostic pop
  39. #endif