MCPcopy Create free account
hub / github.com/lief-project/LIEF / Class>

Method Class>

api/python/src/ObjC/objects/pyClass.cpp:10–90  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8namespace LIEF::objc::py {
9template<>
10void 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.

Callers

nothing calls this directly

Calls 5

DeclOptClass · 0.50
methodsMethod · 0.45
protocolsMethod · 0.45
propertiesMethod · 0.45
ivarsMethod · 0.45

Tested by

no test coverage detected