mono-api-type.html

Type support

Synopsis

#include <metadata/metadata.h> #include <metadata/class.h> typedef struct _MonoType MonoType; MonoArrayType* mono_type_get_array_type (MonoType *type); MonoClass* mono_type_get_class (MonoType *type); char* mono_type_get_name (MonoType *type); MonoMethodSignature* mono_type_get_signature (MonoType *type); int mono_type_get_type (MonoType *type); gboolean mono_type_is_byref (MonoType *type); guint32 mono_type_to_unmanaged (MonoType *type, MonoMarshalSpec *mspec, gboolean as_field;

The MonoType represents the unmanaged version of System.Type.

mono_type_get_object
Prototype: mono_type_get_object

mono_type_create_from_typespec
Prototype: mono_type_create_from_typespec

mono_type_full_name
Prototype: mono_type_full_name

mono_type_get_array_type
MonoArrayType* mono_type_get_array_type (MonoType *type)

Parameters

type:
the MonoType operated on
Returns
a MonoArrayType struct describing the array type that type represents. The info includes details such as rank, array element type and the sizes and bounds of multidimensional arrays.
Remarks

It is only valid to call this function if type is a MONO_TYPE_ARRAY.

mono_type_get_class
MonoClass* mono_type_get_class (MonoType *type)

Parameters

type:
the MonoType operated on
Returns
the MonoClass pointer that describes the class that type represents.
Remarks

It is only valid to call this function if type is a MONO_TYPE_CLASS or a MONO_TYPE_VALUETYPE. For more general functionality, use mono_class_from_mono_type (), instead

mono_type_get_desc
Prototype: mono_type_get_desc

mono_type_get_modifiers
Prototype: mono_type_get_modifiers

mono_type_get_name
char* mono_type_get_name (MonoType *type)

Parameters

type:
a type
Returns
the string representation for type as it would be represented in IL code.
mono_type_get_signature
MonoMethodSignature* mono_type_get_signature (MonoType *type)

Parameters

type:
the MonoType operated on
Returns
the MonoMethodSignature pointer that describes the signature of the function pointer type represents.
Remarks

It is only valid to call this function if type is a MONO_TYPE_FNPTR.

mono_type_get_type
int mono_type_get_type (MonoType *type)

Parameters

type:
the MonoType operated on
Returns
the IL type value for type. This is one of the MonoTypeEnum enum members like MONO_TYPE_I4 or MONO_TYPE_STRING.
mono_type_get_underlying_type
Prototype: mono_type_get_underlying_type

mono_type_is_byref
gboolean mono_type_is_byref (MonoType *type)

Parameters

type:
the MonoType operated on
Returns
TRUE if type represents a type passed by reference, FALSE otherwise.
mono_type_size
Prototype: mono_type_size

mono_type_stack_size
Prototype: mono_type_stack_size

mono_type_to_unmanaged
guint32 mono_type_to_unmanaged (MonoType *type, MonoMarshalSpec *mspec, gboolean as_field, gboolean unicode, MonoMarshalConv *conv)

Returns

A MonoMarshalNative enumeration value (MONO_NATIVE_) value describing the underlying native reprensetation of the type.

In addition the value pointed by "conv" will contain the kind of marshalling required for this particular type one of the MONO_MARSHAL_CONV_ enumeration values.