文字列変換 アンマネージからマネージ [詳細]
Static Public メソッド | |
static unsafe string | String (void *str) |
アンマネージUTF文字列変換 | |
static unsafe string | String (IntPtr ValPtr) |
アンマネージUTF文字列変換 | |
static unsafe string | StringAnsi (IntPtr ValPtr) |
アンマネージANSI文字列変換 | |
static unsafe string | String (void *str, int isize) |
アンマネージUTF文字列変換 | |
static unsafe string | String (IntPtr ValPtr, int isize) |
アンマネージUTF文字列変換 |
文字列変換 アンマネージからマネージ
StringFromC.cs の 10 行で定義されています。
static unsafe string SQLiteCSLib.Inner.StringFromC.String | ( | IntPtr | ValPtr, | |
int | isize | |||
) | [static] |
アンマネージUTF文字列変換
str | アンマネージ文字列ポインタ | |
isize | 文字数(バイト数では無いので注意) |
StringFromC.cs の 97 行で定義されています。
static unsafe string SQLiteCSLib.Inner.StringFromC.String | ( | void * | str, | |
int | isize | |||
) | [static] |
アンマネージUTF文字列変換
str | アンマネージ文字列ポインタ | |
isize | 文字数(バイト数では無いので注意) |
StringFromC.cs の 81 行で定義されています。
static unsafe string SQLiteCSLib.Inner.StringFromC.String | ( | IntPtr | ValPtr | ) | [static] |
static unsafe string SQLiteCSLib.Inner.StringFromC.String | ( | void * | str | ) | [static] |
static unsafe string SQLiteCSLib.Inner.StringFromC.StringAnsi | ( | IntPtr | ValPtr | ) | [static] |
アンマネージANSI文字列変換
ValPtr | アンマネージ文字列ポインタ |
StringFromC.cs の 46 行で定義されています。
00047 { 00048 #if MOBILEPC 00049 ArrayList ansistr = new ArrayList(); 00050 int iTop = ValPtr.ToInt32(); 00051 00052 while( true ) 00053 { 00054 IntPtr pPos = new IntPtr(iTop++); 00055 byte bBin = Marshal.ReadByte( pPos ); 00056 if( bBin == 0x00 ) 00057 { 00058 break; 00059 } 00060 00061 ansistr.Add( bBin ); 00062 } 00063 00064 byte[] ansibin = ansistr.ToArray( typeof(byte) ) as byte[]; 00065 System.Text.Decoder dec = System.Text.Encoding.ASCII.GetDecoder(); 00066 int iLen = ansibin.Length; 00067 char[] cChars= new char[iLen]; 00068 dec.GetChars(ansibin,0,iLen, cChars, 0 ); 00069 return new string(cChars); 00070 #else 00071 return Marshal.PtrToStringAnsi( ValPtr ); 00072 #endif 00073 }