C# Class xZune.Bass.Interop.InteropHelper

Some helper method of interoperate with unmanaged DLLs.
Mostra file Open project: higankanshi/xZune.Bass

Public Methods

Method Description
PtrToString ( IntPtr ptr, Encoding encoding = null, int count = -1 ) : String

Convert a pointer of string to managed string.

PtrToStringArray ( IntPtr ptr ) : String[]
PtrsToStringArray ( IntPtr ptrs, int length ) : String[]

Convert a pointer array to String array.

StringArrayToPtr ( String strings ) : IntPtr

Get a pointer of String array.

StringToPtr ( String str ) : AutoFreeGCHandle

Pinned a String to get pointer of this.

StringToPtr ( String str, int length ) : AutoFreeGCHandle

Pinned a String to get pointer of this.

Method Details

PtrToString() public static method

Convert a pointer of string to managed string.
public static PtrToString ( IntPtr ptr, Encoding encoding = null, int count = -1 ) : String
ptr System.IntPtr pointer of string
encoding System.Text.Encoding encoding of string
count int count of string, -1 mean auto check the end char
return String

PtrToStringArray() public static method

public static PtrToStringArray ( IntPtr ptr ) : String[]
ptr System.IntPtr
return String[]

PtrsToStringArray() public static method

Convert a pointer array to String array.
public static PtrsToStringArray ( IntPtr ptrs, int length ) : String[]
ptrs System.IntPtr pointer array
length int length of pointer array
return String[]

StringArrayToPtr() public static method

Get a pointer of String array.
public static StringArrayToPtr ( String strings ) : IntPtr
strings String array
return System.IntPtr

StringToPtr() public static method

Pinned a String to get pointer of this.
public static StringToPtr ( String str ) : AutoFreeGCHandle
str String string you need pinned
return AutoFreeGCHandle

StringToPtr() public static method

Pinned a String to get pointer of this.
public static StringToPtr ( String str, int length ) : AutoFreeGCHandle
str String string you need pinned
length int
return AutoFreeGCHandle