MCPcopy Create free account
hub / github.com/InteractiveComputerGraphics/SPlisHSPlasH / str

Method str

extern/pybind/include/pybind11/pytypes.h:1599–1607  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1597
1598 template <typename SzType, detail::enable_if_t<std::is_integral<SzType>::value, int> = 0>
1599 str(const char *c, const SzType &n)
1600 : object(PyUnicode_FromStringAndSize(c, ssize_t_cast(n)), stolen_t{}) {
1601 if (!m_ptr) {
1602 if (PyErr_Occurred()) {
1603 throw error_already_set();
1604 }
1605 pybind11_fail("Could not allocate string object!");
1606 }
1607 }
1608
1609 // 'explicit' is explicitly omitted from the following constructors to allow implicit
1610 // conversion to py::str from C++ string-like objects

Callers

nothing calls this directly

Calls 4

ssize_t_castFunction · 0.85
ptrMethod · 0.80
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected