5 #ifndef _MONO_CLI_CLASS_H_
6 #define _MONO_CLI_CLASS_H_
8 #include <mono/metadata/metadata.h>
9 #include <mono/metadata/image.h>
10 #include <mono/metadata/loader.h>
11 #include <mono/utils/mono-error.h>
15 typedef struct MonoVTable MonoVTable
;
17 typedef struct _MonoClassField MonoClassField
;
18 typedef struct _MonoProperty MonoProperty
;
19 typedef struct _MonoEvent MonoEvent
;
22 MONO_TYPE_NAME_FORMAT_IL
,
23 MONO_TYPE_NAME_FORMAT_REFLECTION
,
24 MONO_TYPE_NAME_FORMAT_FULL_NAME
,
25 MONO_TYPE_NAME_FORMAT_ASSEMBLY_QUALIFIED
28 MONO_API MONO_RT_EXTERNAL_ONLY
30 mono_class_get (MonoImage
*image
, uint32_t type_token
);
32 MONO_API MONO_RT_EXTERNAL_ONLY
34 mono_class_get_full (MonoImage
*image
, uint32_t type_token
, MonoGenericContext
*context
);
36 MONO_API MONO_RT_EXTERNAL_ONLY mono_bool
37 mono_class_init (MonoClass
*klass
);
39 MONO_API MONO_RT_EXTERNAL_ONLY
41 mono_class_vtable (MonoDomain
*domain
, MonoClass
*klass
);
43 MONO_API MONO_RT_EXTERNAL_ONLY MonoClass
*
44 mono_class_from_name (MonoImage
*image
, const char* name_space
, const char *name
);
46 MONO_API MONO_RT_EXTERNAL_ONLY MonoClass
*
47 mono_class_from_name_case (MonoImage
*image
, const char* name_space
, const char *name
);
49 MONO_API MONO_RT_EXTERNAL_ONLY MonoMethod
*
50 mono_class_get_method_from_name_flags (MonoClass
*klass
, const char *name
, int param_count
, int flags
);
52 MONO_API MONO_RT_EXTERNAL_ONLY MonoClass
*
53 mono_class_from_typeref (MonoImage
*image
, uint32_t type_token
);
56 mono_class_from_typeref_checked (MonoImage
*image
, uint32_t type_token
, MonoError
*error
);
58 MONO_API MONO_RT_EXTERNAL_ONLY
60 mono_class_from_generic_parameter (MonoGenericParam
*param
, MonoImage
*image
, mono_bool is_mvar
);
62 MONO_API MONO_RT_EXTERNAL_ONLY MonoType
*
63 mono_class_inflate_generic_type (MonoType
*type
, MonoGenericContext
*context
) /* MONO_DEPRECATED */;
65 MONO_API MONO_RT_EXTERNAL_ONLY
67 mono_class_inflate_generic_method (MonoMethod
*method
, MonoGenericContext
*context
);
69 MONO_API MONO_RT_EXTERNAL_ONLY
71 mono_get_inflated_method (MonoMethod
*method
);
73 MONO_API MONO_RT_EXTERNAL_ONLY
75 mono_field_from_token (MonoImage
*image
, uint32_t token
, MonoClass
**retklass
, MonoGenericContext
*context
);
77 MONO_API MONO_RT_EXTERNAL_ONLY
79 mono_bounded_array_class_get (MonoClass
*element_class
, uint32_t rank
, mono_bool bounded
);
81 MONO_API MONO_RT_EXTERNAL_ONLY
83 mono_array_class_get (MonoClass
*element_class
, uint32_t rank
);
85 MONO_API MONO_RT_EXTERNAL_ONLY
87 mono_ptr_class_get (MonoType
*type
);
89 MONO_API MonoClassField
*
90 mono_class_get_field (MonoClass
*klass
, uint32_t field_token
);
92 MONO_API MONO_RT_EXTERNAL_ONLY
94 mono_class_get_field_from_name (MonoClass
*klass
, const char *name
);
97 mono_class_get_field_token (MonoClassField
*field
);
100 mono_class_get_event_token (MonoEvent
*event
);
102 MONO_API MONO_RT_EXTERNAL_ONLY MonoProperty
*
103 mono_class_get_property_from_name (MonoClass
*klass
, const char *name
);
106 mono_class_get_property_token (MonoProperty
*prop
);
109 mono_array_element_size (MonoClass
*ac
);
112 mono_class_instance_size (MonoClass
*klass
);
115 mono_class_array_element_size (MonoClass
*klass
);
118 mono_class_data_size (MonoClass
*klass
);
121 mono_class_value_size (MonoClass
*klass
, uint32_t *align
);
124 mono_class_min_align (MonoClass
*klass
);
126 MONO_API MONO_RT_EXTERNAL_ONLY MonoClass
*
127 mono_class_from_mono_type (MonoType
*type
);
129 MONO_API MONO_RT_EXTERNAL_ONLY mono_bool
130 mono_class_is_subclass_of (MonoClass
*klass
, MonoClass
*klassc
,
131 mono_bool check_interfaces
);
133 MONO_API MONO_RT_EXTERNAL_ONLY mono_bool
134 mono_class_is_assignable_from (MonoClass
*klass
, MonoClass
*oklass
);
136 MONO_API MONO_RT_EXTERNAL_ONLY
138 mono_ldtoken (MonoImage
*image
, uint32_t token
, MonoClass
**retclass
, MonoGenericContext
*context
);
141 mono_type_get_name_full (MonoType
*type
, MonoTypeNameFormat format
);
144 mono_type_get_name (MonoType
*type
);
147 mono_type_get_underlying_type (MonoType
*type
);
149 /* MonoClass accessors */
151 mono_class_get_image (MonoClass
*klass
);
153 MONO_API MONO_RT_EXTERNAL_ONLY
155 mono_class_get_element_class (MonoClass
*klass
);
157 MONO_API MONO_RT_EXTERNAL_ONLY
159 mono_class_is_valuetype (MonoClass
*klass
);
161 MONO_API MONO_RT_EXTERNAL_ONLY
163 mono_class_is_enum (MonoClass
*klass
);
165 MONO_API MONO_RT_EXTERNAL_ONLY MonoType
*
166 mono_class_enum_basetype (MonoClass
*klass
);
168 MONO_API MONO_RT_EXTERNAL_ONLY
170 mono_class_get_parent (MonoClass
*klass
);
173 mono_class_get_nesting_type (MonoClass
*klass
);
176 mono_class_get_rank (MonoClass
*klass
);
179 mono_class_get_flags (MonoClass
*klass
);
181 MONO_API MONO_RT_EXTERNAL_ONLY
183 mono_class_get_name (MonoClass
*klass
);
185 MONO_API MONO_RT_EXTERNAL_ONLY
187 mono_class_get_namespace (MonoClass
*klass
);
189 MONO_API MONO_RT_EXTERNAL_ONLY MonoType
*
190 mono_class_get_type (MonoClass
*klass
);
193 mono_class_get_type_token (MonoClass
*klass
);
196 mono_class_get_byref_type (MonoClass
*klass
);
199 mono_class_num_fields (MonoClass
*klass
);
202 mono_class_num_methods (MonoClass
*klass
);
205 mono_class_num_properties (MonoClass
*klass
);
208 mono_class_num_events (MonoClass
*klass
);
210 MONO_API MONO_RT_EXTERNAL_ONLY
212 mono_class_get_fields (MonoClass
* klass
, void **iter
);
215 mono_class_get_methods (MonoClass
* klass
, void **iter
);
217 MONO_API MonoProperty
*
218 mono_class_get_properties (MonoClass
* klass
, void **iter
);
221 mono_class_get_events (MonoClass
* klass
, void **iter
);
224 mono_class_get_interfaces (MonoClass
* klass
, void **iter
);
227 mono_class_get_nested_types (MonoClass
* klass
, void **iter
);
229 MONO_API MONO_RT_EXTERNAL_ONLY
231 mono_class_is_delegate (MonoClass
* klass
);
233 MONO_API MONO_RT_EXTERNAL_ONLY mono_bool
234 mono_class_implements_interface (MonoClass
* klass
, MonoClass
* iface
);
236 /* MonoClassField accessors */
238 mono_field_get_name (MonoClassField
*field
);
241 mono_field_get_type (MonoClassField
*field
);
244 mono_field_get_parent (MonoClassField
*field
);
247 mono_field_get_flags (MonoClassField
*field
);
250 mono_field_get_offset (MonoClassField
*field
);
252 MONO_API
const char *
253 mono_field_get_data (MonoClassField
*field
);
255 /* MonoProperty acessors */
257 mono_property_get_name (MonoProperty
*prop
);
260 mono_property_get_set_method (MonoProperty
*prop
);
263 mono_property_get_get_method (MonoProperty
*prop
);
266 mono_property_get_parent (MonoProperty
*prop
);
269 mono_property_get_flags (MonoProperty
*prop
);
271 /* MonoEvent accessors */
273 mono_event_get_name (MonoEvent
*event
);
276 mono_event_get_add_method (MonoEvent
*event
);
279 mono_event_get_remove_method (MonoEvent
*event
);
282 mono_event_get_remove_method (MonoEvent
*event
);
285 mono_event_get_raise_method (MonoEvent
*event
);
288 mono_event_get_parent (MonoEvent
*event
);
291 mono_event_get_flags (MonoEvent
*event
);
293 MONO_API MONO_RT_EXTERNAL_ONLY MonoMethod
*
294 mono_class_get_method_from_name (MonoClass
*klass
, const char *name
, int param_count
);
297 mono_class_name_from_token (MonoImage
*image
, uint32_t type_token
);
300 mono_method_can_access_field (MonoMethod
*method
, MonoClassField
*field
);
303 mono_method_can_access_method (MonoMethod
*method
, MonoMethod
*called
);
306 mono_class_is_nullable (MonoClass
*klass
);
308 MONO_API MONO_RT_EXTERNAL_ONLY MonoClass
*
309 mono_class_get_nullable_param (MonoClass
*klass
);
313 #endif /* _MONO_CLI_CLASS_H_ */