Lines Matching refs:m_py_obj

82   if (m_py_obj && Py_IsInitialized()) {  in Reset()
88 Py_DECREF(m_py_obj); in Reset()
92 m_py_obj = nullptr; in Reset()
96 if (!m_py_obj) in AsLongLong()
99 long long r = PyLong_AsLongLong(m_py_obj); in AsLongLong()
106 if (!m_py_obj) in AsUnsignedLongLong()
109 long long r = PyLong_AsUnsignedLongLong(m_py_obj); in AsUnsignedLongLong()
117 if (!m_py_obj) in AsModuloUnsignedLongLong()
120 unsigned long long r = PyLong_AsUnsignedLongLongMask(m_py_obj); in AsModuloUnsignedLongLong()
133 if (m_py_obj) { in Dump()
136 ::PyObject_Print(m_py_obj, file, 0); in Dump()
156 if (PythonModule::Check(m_py_obj)) in GetObjectType()
158 if (PythonList::Check(m_py_obj)) in GetObjectType()
160 if (PythonTuple::Check(m_py_obj)) in GetObjectType()
162 if (PythonDictionary::Check(m_py_obj)) in GetObjectType()
164 if (PythonString::Check(m_py_obj)) in GetObjectType()
166 if (PythonBytes::Check(m_py_obj)) in GetObjectType()
168 if (PythonByteArray::Check(m_py_obj)) in GetObjectType()
170 if (PythonBoolean::Check(m_py_obj)) in GetObjectType()
172 if (PythonInteger::Check(m_py_obj)) in GetObjectType()
174 if (PythonFile::Check(m_py_obj)) in GetObjectType()
176 if (PythonCallable::Check(m_py_obj)) in GetObjectType()
182 if (!m_py_obj) in Repr()
184 PyObject *repr = PyObject_Repr(m_py_obj); in Repr()
191 if (!m_py_obj) in Str()
193 PyObject *str = PyObject_Str(m_py_obj); in Str()
247 return !!PyObject_HasAttr(m_py_obj, py_attr.get()); in HasAttribute()
255 if (!PyObject_HasAttr(m_py_obj, py_attr.get())) in GetAttributeValue()
259 PyObject_GetAttr(m_py_obj, py_attr.get())); in GetAttributeValue()
266 return PythonDictionary(PyRefType::Borrowed, m_py_obj) in CreateStructuredObject()
269 return PythonBoolean(PyRefType::Borrowed, m_py_obj) in CreateStructuredObject()
272 return PythonInteger(PyRefType::Borrowed, m_py_obj) in CreateStructuredObject()
275 return PythonList(PyRefType::Borrowed, m_py_obj).CreateStructuredArray(); in CreateStructuredObject()
277 return PythonString(PyRefType::Borrowed, m_py_obj).CreateStructuredString(); in CreateStructuredObject()
279 return PythonBytes(PyRefType::Borrowed, m_py_obj).CreateStructuredString(); in CreateStructuredObject()
281 return PythonByteArray(PyRefType::Borrowed, m_py_obj) in CreateStructuredObject()
287 PythonObject(PyRefType::Borrowed, m_py_obj))); in CreateStructuredObject()
312 PyBytes_AsStringAndSize(m_py_obj, &c, &size); in GetBytes()
319 return PyBytes_Size(m_py_obj); in GetSize()
331 PyBytes_AsStringAndSize(m_py_obj, &c, &size); in CreateStructuredString()
354 char *c = PyByteArray_AsString(m_py_obj); in GetBytes()
363 return PyByteArray_Size(m_py_obj); in GetSize()
410 data = PyUnicode_AsUTF8AndSize(m_py_obj, &size); in AsUTF8()
421 return PyUnicode_GetLength(m_py_obj); in GetSize()
423 return PyUnicode_GetSize(m_py_obj); in GetSize()
488 return m_py_obj ? PyObject_IsTrue(m_py_obj) : false; in GetValue()
520 return PyList_GET_SIZE(m_py_obj); in GetSize()
526 return PythonObject(PyRefType::Borrowed, PyList_GetItem(m_py_obj, index)); in GetItemAtIndex()
535 PyList_SetItem(m_py_obj, index, object.get()); in SetItemAtIndex()
543 PyList_Append(m_py_obj, object.get()); in AppendItem()
569 m_py_obj = PyTuple_New(objects.size()); in PythonTuple()
580 m_py_obj = PyTuple_New(objects.size()); in PythonTuple()
599 return PyTuple_GET_SIZE(m_py_obj); in GetSize()
605 return PythonObject(PyRefType::Borrowed, PyTuple_GetItem(m_py_obj, index)); in GetItemAtIndex()
614 PyTuple_SetItem(m_py_obj, index, object.get()); in SetItemAtIndex()
644 return PyDict_Size(m_py_obj); in GetSize()
650 return PythonList(PyRefType::Owned, PyDict_Keys(m_py_obj)); in GetKeys()
667 PyObject *o = PyDict_GetItemWithError(m_py_obj, key.get()); in GetItem()
678 PyObject *o = PyDict_GetItemString(m_py_obj, NullTerminated(key)); in GetItem()
690 int r = PyDict_SetItem(m_py_obj, key.get(), value.get()); in SetItem()
700 int r = PyDict_SetItemString(m_py_obj, NullTerminated(key), value.get()); in SetItem()
746 PyObject *dict = PyModule_GetDict(m_py_obj); in Get()
765 return Retain<PythonDictionary>(PyModule_GetDict(m_py_obj)); in GetDictionary()
822 if (PyType_Check(m_py_obj) || PyClass_Check(m_py_obj)) { in GetArgInfo()
829 py_func_obj = m_py_obj; in GetArgInfo()
875 return PythonObject(PyRefType::Owned, PyObject_CallObject(m_py_obj, nullptr)); in operator ()()
882 PyObject_CallObject(m_py_obj, arg_tuple.get())); in operator ()()
889 PyObject_CallObject(m_py_obj, arg_tuple.get())); in operator ()()
1036 : Base(args...), m_py_obj(file), m_borrowed(borrowed) { in OwnedPythonFile()
1037 assert(m_py_obj); in OwnedPythonFile()
1041 assert(m_py_obj); in ~OwnedPythonFile()
1046 m_py_obj.Reset(); in ~OwnedPythonFile()
1051 auto closed = As<bool>(m_py_obj.GetAttribute("closed")); in IsPythonSideValid()
1064 assert(m_py_obj); in Close()
1068 auto r = m_py_obj.CallMethod("close"); in Close()
1079 assert(m_py_obj.IsValid()); in GetPythonObject()
1080 return m_py_obj.get(); in GetPythonObject()
1086 PythonFile m_py_obj; member in __anon7439c15d0111::OwnedPythonFile
1155 assert(m_py_obj); in Close()
1159 auto r = m_py_obj.CallMethod("close"); in Close()
1167 auto r = m_py_obj.CallMethod("flush"); in Flush()
1175 return GetOptionsForPyObject(m_py_obj); in GetOptions()
1208 auto bytes_written = As<long long>(m_py_obj.CallMethod("write", pybuffer)); in Write()
1222 m_py_obj.CallMethod("read", (unsigned long long)num_bytes); in Read()
1262 As<long long>(m_py_obj.CallMethod("write", pystring.get())); in Write()
1281 m_py_obj.CallMethod("read", (unsigned long long)num_chars)); in Read()
1303 int fd = PyObject_AsFileDescriptor(m_py_obj); in ConvertToFile()
1348 int fd = PyObject_AsFileDescriptor(m_py_obj); in ConvertToFileForcingUseOfScriptingIOMethods()