aboutsummaryrefslogtreecommitdiff
path: root/lldb/include/lldb/Utility/DataBuffer.h
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/include/lldb/Utility/DataBuffer.h')
-rw-r--r--lldb/include/lldb/Utility/DataBuffer.h20
1 files changed, 17 insertions, 3 deletions
diff --git a/lldb/include/lldb/Utility/DataBuffer.h b/lldb/include/lldb/Utility/DataBuffer.h
index 523569301e84..302b13307958 100644
--- a/lldb/include/lldb/Utility/DataBuffer.h
+++ b/lldb/include/lldb/Utility/DataBuffer.h
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef liblldb_DataBuffer_h_
-#define liblldb_DataBuffer_h_
+#ifndef LLDB_UTILITY_DATABUFFER_H
+#define LLDB_UTILITY_DATABUFFER_H
#if defined(__cplusplus)
#include <stdint.h>
@@ -79,7 +79,21 @@ public:
}
};
+class DataBufferUnowned : public DataBuffer {
+public:
+ DataBufferUnowned(uint8_t *bytes, lldb::offset_t size)
+ : m_bytes(bytes), m_size(size) {}
+
+ uint8_t *GetBytes() override { return m_bytes; }
+ const uint8_t *GetBytes() const override { return m_bytes; }
+ lldb::offset_t GetByteSize() const override { return m_size; }
+
+private:
+ uint8_t *m_bytes;
+ lldb::offset_t m_size;
+};
+
} // namespace lldb_private
#endif /// #if defined(__cplusplus)
-#endif /// lldb_DataBuffer_h_
+#endif // LLDB_UTILITY_DATABUFFER_H