1 //===--- DataBufferLLVM.h ---------------------------------------*- C++ -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 #ifndef LLDB_CORE_DATABUFFERLLVM_H
10 #define LLDB_CORE_DATABUFFERLLVM_H
12 #include "lldb/Utility/DataBuffer.h"
13 #include "lldb/lldb-types.h"
19 class WritableMemoryBuffer;
23 namespace lldb_private {
26 class DataBufferLLVM : public DataBuffer {
28 ~DataBufferLLVM() override;
30 uint8_t *GetBytes() override;
31 const uint8_t *GetBytes() const override;
32 lldb::offset_t GetByteSize() const override;
34 char *GetChars() { return reinterpret_cast<char *>(GetBytes()); }
38 /// Construct a DataBufferLLVM from \p Buffer. \p Buffer must be a valid
40 explicit DataBufferLLVM(std::unique_ptr<llvm::WritableMemoryBuffer> Buffer);
42 std::unique_ptr<llvm::WritableMemoryBuffer> Buffer;