MCPcopy Create free account
hub / github.com/Kitware/VTK / vtkPythonGetStringSize

Function vtkPythonGetStringSize

Wrapping/PythonCore/vtkPythonArgs.cxx:85–102  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

83}
84
85Py_ssize_t vtkPythonGetStringSize(PyObject* o)
86{
87 if (PyBytes_Check(o))
88 {
89 return PyBytes_Size(o);
90 }
91 else if (PyByteArray_Check(o))
92 {
93 return PyByteArray_Size(o);
94 }
95 else if (PyUnicode_Check(o))
96 {
97 Py_ssize_t size;
98 PyUnicode_AsUTF8AndSize(o, &size);
99 return size;
100 }
101 return 0;
102}
103
104bool vtkPythonGetStringValue(PyObject* o, const char*& a, const char* exctext)
105{

Callers 2

vtkPythonGetArrayFunction · 0.85
GetStringSizeMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected