| 8 | namespace LIEF::objc::py { |
| 9 | template<> |
| 10 | void create<objc::Class>(nb::module_& m) { |
| 11 | nb::class_<objc::Class> clazz(m, "Class", |
| 12 | R"doc( |
| 13 | This class represents an Objective-C class (``@interface``) |
| 14 | )doc"_doc |
| 15 | ); |
| 16 | clazz |
| 17 | .def_prop_ro("name", &objc::Class::name, |
| 18 | R"doc( |
| 19 | Name of the class |
| 20 | )doc"_doc |
| 21 | ) |
| 22 | .def_prop_ro("demangled_name", &objc::Class::demangled_name, |
| 23 | R"doc( |
| 24 | Demangled name of the class |
| 25 | )doc"_doc |
| 26 | ) |
| 27 | .def_prop_ro("super_class", &objc::Class::super_class, |
| 28 | R"doc( |
| 29 | Parent class in case of inheritance |
| 30 | )doc"_doc |
| 31 | ) |
| 32 | .def_prop_ro("is_meta", &objc::Class::is_meta, |
| 33 | R"doc( |
| 34 | |
| 35 | )doc"_doc |
| 36 | ) |
| 37 | .def_prop_ro("methods", |
| 38 | [] (objc::Class& self) { |
| 39 | auto methods = self.methods(); |
| 40 | return nb::make_iterator<nb::rv_policy::reference_internal>( |
| 41 | nb::type<objc::Class>(), "methods_it", methods |
| 42 | ); |
| 43 | }, nb::keep_alive<0, 1>(), |
| 44 | R"doc( |
| 45 | Iterator over the different methods defined by this class. |
| 46 | )doc"_doc |
| 47 | ) |
| 48 | .def_prop_ro("protocols", |
| 49 | [] (objc::Class& self) { |
| 50 | auto protocols = self.protocols(); |
| 51 | return nb::make_iterator<nb::rv_policy::reference_internal>( |
| 52 | nb::type<objc::Class>(), "protocols_it", protocols |
| 53 | ); |
| 54 | }, nb::keep_alive<0, 1>(), |
| 55 | R"doc( |
| 56 | Iterator over the different protocols implemented by this class. |
| 57 | )doc"_doc |
| 58 | ) |
| 59 | .def_prop_ro("properties", |
| 60 | [] (objc::Class& self) { |
| 61 | auto properties = self.properties(); |
| 62 | return nb::make_iterator<nb::rv_policy::reference_internal>( |
| 63 | nb::type<objc::Class>(), "properties_it", properties |
| 64 | ); |
| 65 | }, nb::keep_alive<0, 1>(), |
| 66 | R"doc( |
| 67 | Iterator over the properties of this class. |
nothing calls this directly
no test coverage detected