Class ExecutionEncodingStringMarshaller
- Namespace
- Ubiquity.NET.InteropHelpers
- Assembly
- Ubiquity.NET.InteropHelpers.dll
Represents a marshaller for native strings using Encoding.
[CustomMarshaller(typeof(string), MarshalMode.Default, typeof(ExecutionEncodingStringMarshaller))]
[CustomMarshaller(typeof(string), MarshalMode.ManagedToUnmanagedIn, typeof(ExecutionEncodingStringMarshaller.ManagedToUnmanagedIn))]
public static class ExecutionEncodingStringMarshaller
- Inheritance
-
ExecutionEncodingStringMarshaller
- Inherited Members
Remarks
This will handle marshalling of strings to/from native code. This is very similar to the default string marshalling support except that it does all conversion to/from native code via a static Encoding property, [defaults to UTF8] so that applications can have control of that.
Properties
- Encoding
Gets or sets the ExecutionEncoding for the native code
Methods
- ConvertToManaged(byte*)
Converts an unmanaged string to a managed version.
- ConvertToUnmanaged(string?)
Converts a string to an unmanaged version.
- Free(byte*)
Frees the memory for the unmanaged string representation allocated by ConvertToUnmanaged(string?)
- ReadOnlySpanFromNullTerminated(byte*)
Creates a ReadOnlySpan from a null terminated native string