2016-04-29 19:22:58 +02:00
|
|
|
//===- ByteStream.h - Reads stream data from a byte sequence ----*- C++ -*-===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2016-05-25 22:37:03 +02:00
|
|
|
#ifndef LLVM_DEBUGINFO_CODEVIEW_BYTESTREAM_H
|
|
|
|
#define LLVM_DEBUGINFO_CODEVIEW_BYTESTREAM_H
|
2016-04-29 19:22:58 +02:00
|
|
|
|
|
|
|
#include "llvm/ADT/ArrayRef.h"
|
2016-05-10 01:11:38 +02:00
|
|
|
#include "llvm/ADT/StringRef.h"
|
2016-05-25 22:37:03 +02:00
|
|
|
#include "llvm/DebugInfo/CodeView/StreamInterface.h"
|
2016-05-10 01:11:38 +02:00
|
|
|
#include "llvm/Support/Error.h"
|
|
|
|
#include <cstdint>
|
|
|
|
#include <memory>
|
2016-04-29 19:22:58 +02:00
|
|
|
|
|
|
|
namespace llvm {
|
2016-05-25 22:37:03 +02:00
|
|
|
namespace codeview {
|
2016-04-29 19:22:58 +02:00
|
|
|
class StreamReader;
|
2016-05-10 01:11:38 +02:00
|
|
|
|
2016-04-29 19:22:58 +02:00
|
|
|
class ByteStream : public StreamInterface {
|
|
|
|
public:
|
|
|
|
ByteStream();
|
2016-05-28 07:21:57 +02:00
|
|
|
explicit ByteStream(ArrayRef<uint8_t> Data);
|
2016-04-29 19:22:58 +02:00
|
|
|
~ByteStream() override;
|
|
|
|
|
2016-05-27 03:54:44 +02:00
|
|
|
Error readBytes(uint32_t Offset, uint32_t Size,
|
|
|
|
ArrayRef<uint8_t> &Buffer) const override;
|
2016-05-03 02:28:21 +02:00
|
|
|
|
2016-04-29 19:22:58 +02:00
|
|
|
uint32_t getLength() const override;
|
|
|
|
|
|
|
|
ArrayRef<uint8_t> data() const { return Data; }
|
2016-05-02 20:09:14 +02:00
|
|
|
StringRef str() const;
|
2016-04-29 19:22:58 +02:00
|
|
|
|
|
|
|
private:
|
2016-05-28 07:21:57 +02:00
|
|
|
ArrayRef<uint8_t> Data;
|
2016-04-29 19:22:58 +02:00
|
|
|
};
|
|
|
|
|
2016-05-10 01:11:38 +02:00
|
|
|
} // end namespace pdb
|
|
|
|
} // end namespace llvm
|
|
|
|
|
2016-05-25 22:37:03 +02:00
|
|
|
#endif // LLVM_DEBUGINFO_CODEVIEW_BYTESTREAM_H
|