Class NativeTypeConversion
- Namespace
- CarinaStudio.MacOS
- Assembly
- CarinaStudio.AppBase.MacOS.dll
Conversion between native and CLR types. The class is not supposed to be used directly. It is used for internal type conversion and code generation.
public static class NativeTypeConversion
- Inheritance
-
NativeTypeConversion
- Inherited Members
Methods
FromNativeParameter(object, Type)
Convert from native parameter to CLR parameter.
public static object? FromNativeParameter(object nativeValue, Type targetType)
Parameters
Returns
FromNativeValue(byte*, int, Type, out int)
Convert from native value to CLR value.
public static object? FromNativeValue(byte* valuePtr, int valueCount, Type targetType, out int consumedBytes)
Parameters
Returns
FromTypeEncoding(string, out int)
Convert from Objective-C type encoding.
public static Type FromTypeEncoding(string typeEncoding, out int elementCount)
Parameters
Returns
GetNativeValueSize(Type)
Get size of native value in bytes.
public static int GetNativeValueSize(Type type)
Parameters
typeType
Returns
IsNativeType(Type)
Check whether given type is the native type or not.
public static bool IsNativeType(Type type)
Parameters
typeType
Returns
ToNativeParameter(object?)
Convert from CLR parameter to native parameter.
public static object ToNativeParameter(object? value)
Parameters
valueobject
Returns
ToNativeType(Type)
Convert to corresponding native type.
public static Type ToNativeType(Type type)
Parameters
typeType
Returns
ToNativeValue(object?, byte*)
Convert from CLR object to native value.
public static int ToNativeValue(object? obj, byte* valuePtr)
Parameters
Returns
ToTypeEncoding(object)
Convert to Objective-C type encoding.
public static string ToTypeEncoding(object obj)
Parameters
objobject
Returns
ToTypeEncoding(Type, int)
Convert to Objective-C type encoding.
public static string ToTypeEncoding(Type type, int elementCount = 1)
Parameters
Returns
ToTypeEncoding<T>(int)
Convert to Objective-C type encoding.
public static string ToTypeEncoding<T>(int elementCount = 1)
Parameters
elementCountint
Returns
Type Parameters
T