MCPcopy Create free account
hub / github.com/apache/arrow / PyUnicode_AsStdString

Function PyUnicode_AsStdString

python/pyarrow/src/arrow/python/helpers.cc:103–111  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

101}
102
103Status PyUnicode_AsStdString(PyObject* obj, std::string* out) {
104 ARROW_DCHECK(PyUnicode_Check(obj));
105 Py_ssize_t size;
106 // The utf-8 representation is cached on the unicode object
107 const char* data = PyUnicode_AsUTF8AndSize(obj, &size);
108 RETURN_IF_PYERROR();
109 *out = std::string(data, size);
110 return Status::OK();
111}
112
113std::string PyObject_StdStringRepr(PyObject* obj) {
114 OwnedRef unicode_ref(PyObject_Repr(obj));

Callers 3

PyObject_StdStringStrFunction · 0.85
TzinfoToStringFunction · 0.85
VisitDictMethod · 0.85

Calls 1

OKFunction · 0.50

Tested by

no test coverage detected