summaryrefslogtreecommitdiffstats
path: root/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2016-01-13 20:06:56 +0000
committerdim <dim@FreeBSD.org>2016-01-13 20:06:56 +0000
commit8553c19974a5ab5f815b9e64f7bfe9899924726b (patch)
tree2b6dc7dcb4a6380cb331aded15f5a81c0038e194 /source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h
parent78b9749c0a4ea980a8b934645da6ae98fcc665e8 (diff)
downloadFreeBSD-src-8553c19974a5ab5f815b9e64f7bfe9899924726b.zip
FreeBSD-src-8553c19974a5ab5f815b9e64f7bfe9899924726b.tar.gz
Vendor import of lldb trunk r257626:
https://llvm.org/svn/llvm-project/lldb/trunk@257626
Diffstat (limited to 'source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h')
-rw-r--r--source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h b/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h
index c9d17c0..06264b6 100644
--- a/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h
+++ b/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h
@@ -23,8 +23,11 @@
#include "lldb/Host/File.h"
#include "lldb/Interpreter/OptionValue.h"
+#include "llvm/ADT/ArrayRef.h"
+
namespace lldb_private {
+class PythonBytes;
class PythonString;
class PythonList;
class PythonDictionary;
@@ -71,6 +74,7 @@ enum class PyObjectType
Dictionary,
List,
String,
+ Bytes,
Module,
Callable,
Tuple,
@@ -256,6 +260,39 @@ protected:
PyObject* m_py_obj;
};
+class PythonBytes : public PythonObject
+{
+public:
+ PythonBytes();
+ explicit PythonBytes(llvm::ArrayRef<uint8_t> bytes);
+ PythonBytes(const uint8_t *bytes, size_t length);
+ PythonBytes(PyRefType type, PyObject *o);
+ PythonBytes(const PythonBytes &object);
+
+ ~PythonBytes() override;
+
+ static bool
+ Check(PyObject *py_obj);
+
+ // Bring in the no-argument base class version
+ using PythonObject::Reset;
+
+ void
+ Reset(PyRefType type, PyObject *py_obj) override;
+
+ llvm::ArrayRef<uint8_t>
+ GetBytes() const;
+
+ size_t
+ GetSize() const;
+
+ void
+ SetBytes(llvm::ArrayRef<uint8_t> stringbytes);
+
+ StructuredData::StringSP
+ CreateStructuredString() const;
+};
+
class PythonString : public PythonObject
{
public:
OpenPOWER on IntegriCloud