1
0
Fork 0
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

47 lines
1.2 KiB

//===--- DataBufferLLVM.h ---------------------------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#ifndef LLDB_UTILITY_DATABUFFERLLVM_H
#define LLDB_UTILITY_DATABUFFERLLVM_H
#include "lldb/Utility/DataBuffer.h"
#include "lldb/lldb-types.h"
#include <memory>
#include <stdint.h>
namespace llvm {
class WritableMemoryBuffer;
class Twine;
}
namespace lldb_private {
class FileSystem;
class DataBufferLLVM : public DataBuffer {
public:
~DataBufferLLVM() override;
uint8_t *GetBytes() override;
const uint8_t *GetBytes() const override;
lldb::offset_t GetByteSize() const override;
char *GetChars() { return reinterpret_cast<char *>(GetBytes()); }
private:
friend FileSystem;
/// Construct a DataBufferLLVM from \p Buffer. \p Buffer must be a valid
/// pointer.
explicit DataBufferLLVM(std::unique_ptr<llvm::WritableMemoryBuffer> Buffer);
std::unique_ptr<llvm::WritableMemoryBuffer> Buffer;
};
}
#endif