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

Function PyUnicode_AsStdString

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

Source from the content-addressed store, hash-verified

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