From b81d715cd25178d413431258667861485bb0ff89 Mon Sep 17 00:00:00 2001 From: Tatyana Krasnukha Date: Sat, 16 Feb 2019 18:39:14 +0000 Subject: Add PythonBoolean type to the PythonDataObjects Differential Revision: https://reviews.llvm.org/D57817 llvm-svn: 354206 --- .../ScriptInterpreter/Python/PythonDataObjects.h | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h') diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h b/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h index bc6c3c5..48e47f3 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h +++ b/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h @@ -57,6 +57,7 @@ private: enum class PyObjectType { Unknown, None, + Boolean, Integer, Dictionary, List, @@ -297,6 +298,29 @@ public: StructuredData::IntegerSP CreateStructuredInteger() const; }; +class PythonBoolean : public PythonObject { +public: + PythonBoolean() = default; + explicit PythonBoolean(bool value); + PythonBoolean(PyRefType type, PyObject *o); + PythonBoolean(const PythonBoolean &object); + + ~PythonBoolean() override = default; + + 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; + + bool GetValue() const; + + void SetValue(bool value); + + StructuredData::BooleanSP CreateStructuredBoolean() const; +}; + class PythonList : public PythonObject { public: PythonList() {} -- cgit v1.1