aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2015-10-16 17:51:49 +0000
committerZachary Turner <zturner@google.com>2015-10-16 17:51:49 +0000
commit7d6d218e1219f7df284b83dfb3eaa5e5b70e77e8 (patch)
tree20841ad8e031d112a1b143bd60e336bac453eaea /lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h
parenta6760f98cf628f215cea98cf0769c4294ca91cf3 (diff)
downloadllvm-7d6d218e1219f7df284b83dfb3eaa5e5b70e77e8.zip
llvm-7d6d218e1219f7df284b83dfb3eaa5e5b70e77e8.tar.gz
llvm-7d6d218e1219f7df284b83dfb3eaa5e5b70e77e8.tar.bz2
Convert SWIG typemap string operations to PythonObjects.
llvm-svn: 250530
Diffstat (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h')
-rw-r--r--lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h b/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h
index 9351347..2fc6c1c 100644
--- a/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h
+++ b/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h
@@ -201,6 +201,9 @@ public:
bool
HasAttribute(llvm::StringRef attribute) const;
+ PythonObject
+ GetAttributeValue(llvm::StringRef attribute) const;
+
bool
IsValid() const;
@@ -210,6 +213,14 @@ public:
bool
IsNone() const;
+ template<typename T>
+ T AsType() const
+ {
+ if (!T::Check(m_py_obj))
+ return T();
+ return T(PyRefType::Borrowed, m_py_obj);
+ }
+
StructuredData::ObjectSP CreateStructuredObject() const;
protected: