/* OCP.NCollection — the UTF-8 string the font API takes. NCollection_Utf8String is the only NCollection type the app names directly: it wraps the font path and the text to emboss. Constructed from a Python str, which nanobind hands over as UTF-8 already. */ #include "../common/occt_module.h" #include void register_NCollection(nb::module_ &root) { nb::module_ m = ocp_submodule(root, "NCollection"); nb::class_(m, "NCollection_Utf8String") .def(nb::init<>()) // Upstream also offers an explicit-length overload; the app always // passes a whole Python str, which arrives NUL-terminated, so only the // one-argument form is bound. .def( "__init__", [](NCollection_Utf8String *self, const char *text) { new (self) NCollection_Utf8String(text); }, "theCopy"_a) .def("ToCString", &NCollection_Utf8String::ToCString) .def("Size", &NCollection_Utf8String::Size) .def("Length", &NCollection_Utf8String::Length) .def("IsEmpty", &NCollection_Utf8String::IsEmpty) .def("__str__", &NCollection_Utf8String::ToCString); }