SQLite3 ユーザ照合順序関数. [詳細]

Public メソッド | |
| OSQLiteCollation (OSQLiteDBWrap db, ICollationFunction iCallinterface) | |
| コンストラクタ | |
| void | Dispose () |
| 破棄 | |
| ResultEnum | CreateFunction (string funcname) |
| 関数作成 | |
Protected メソッド | |
| unsafe delegate int | CallCollationDelegate (void *NotUsed, int nKey1, IntPtr pKey1, int nKey2, IntPtr pKey2) |
| コールバック型(マネージ) | |
| unsafe virtual int | CallCollation (void *NotUsed, int nKey1, IntPtr pKey1, int nKey2, IntPtr pKey2) |
| 照合順序関数コールバック | |
Static Protected メソッド | |
| static int | osqlite3_createcollation (IntPtr instance, string funcname, int eTextRep, CallCollationDelegate xCompare) |
Protected 変数 | |
| GCHandle | m_callbackpoint |
| コールバックポインタ | |
| OSQLiteDBWrap | m_db |
| データベース | |
| ICollationFunction | m_callinterface |
| コールバックインターフェース | |
SQLite3 ユーザ照合順序関数.
OSQLiteCollation.cs の 10 行で定義されています。
| SQLiteCSLib.Inner.OSQLiteCollation.OSQLiteCollation | ( | OSQLiteDBWrap | db, | |
| ICollationFunction | iCallinterface | |||
| ) |
コンストラクタ
OSQLiteCollation.cs の 53 行で定義されています。
00054 { 00055 m_db = db; 00056 m_callinterface = iCallinterface; 00057 00058 unsafe 00059 { 00060 m_callbackpoint = GCHandle.Alloc( new CallCollationDelegate( CallCollation ) ); 00061 } 00062 00063 #if MOBILEPC 00064 m_disposeevent = CreateEvent( IntPtr.Zero , true, false, IntPtr.Zero ); 00065 #endif 00066 00067 }
| unsafe virtual int SQLiteCSLib.Inner.OSQLiteCollation.CallCollation | ( | void * | NotUsed, | |
| int | nKey1, | |||
| IntPtr | pKey1, | |||
| int | nKey2, | |||
| IntPtr | pKey2 | |||
| ) | [protected, virtual] |
照合順序関数コールバック
| NotUsed | ユーザポインタ | |
| nKey1 | キー1サイズ | |
| pKey1 | キー1 | |
| nKey2 | キー2サイズ | |
| pKey2 | キー2 |
OSQLiteCollation.cs の 171 行で定義されています。
00172 { 00173 //Unicodeデコードを行い、インターフェースをコールする。 00174 byte[] bKey1 = new byte[nKey1+2]; 00175 byte[] bKey2 = new byte[nKey2+2]; 00176 00177 Marshal.Copy( pKey1, bKey1, 0, nKey1 ); 00178 Marshal.Copy( pKey2, bKey2, 0, nKey2 ); 00179 00180 System.Text.Decoder dec = System.Text.Encoding.Unicode.GetDecoder(); 00181 int iLen1 = dec.GetCharCount( bKey1,0,nKey1 ); 00182 char[] cKey1 = new char[iLen1]; 00183 dec.GetChars(bKey1,0,nKey1, cKey1, 0 ); 00184 string sKey1 = new string(cKey1); 00185 00186 int iLen2 = dec.GetCharCount( bKey2,0,nKey2 ); 00187 char[] cKey2 = new char[iLen2]; 00188 dec.GetChars(bKey2,0,nKey2, cKey2, 0 ); 00189 string sKey2 = new string(cKey2); 00190 00191 return m_callinterface.Compare( sKey1, sKey2 ); 00192 }
| unsafe delegate int SQLiteCSLib.Inner.OSQLiteCollation.CallCollationDelegate | ( | void * | NotUsed, | |
| int | nKey1, | |||
| IntPtr | pKey1, | |||
| int | nKey2, | |||
| IntPtr | pKey2 | |||
| ) | [protected] |
コールバック型(マネージ)
| ResultEnum SQLiteCSLib.Inner.OSQLiteCollation.CreateFunction | ( | string | funcname | ) |
関数作成
| funcname |
OSQLiteCollation.cs の 101 行で定義されています。
00102 { 00103 #if MOBILEPC 00104 m_clrevent = CreateEvent( IntPtr.Zero , false, false, IntPtr.Zero ); 00105 00106 //ポーリング開始 00107 System.Threading.Thread thread = new System.Threading.Thread( new System.Threading.ThreadStart(OnCallBackThread) ); 00108 thread.Start(); 00109 00110 return (ResultEnum)osqlite3_createcollation( m_db.internaldb(), funcname, (int)CAPI3REF.UTF16, 00111 m_clrevent, ref m_nativepoint ); 00112 #else 00113 unsafe 00114 { 00115 return (ResultEnum)osqlite3_createcollation( m_db.internaldb(), funcname, (int)CAPI3REF.UTF16, 00116 m_callbackpoint.Target as CallCollationDelegate ); 00117 } 00118 #endif 00119 }
| void SQLiteCSLib.Inner.OSQLiteCollation.Dispose | ( | ) |
破棄
OSQLiteCollation.cs の 80 行で定義されています。
00081 { 00082 #if MOBILEPC 00083 EventModify( m_disposeevent, 3 ); 00084 CloseHandle( m_disposeevent ); 00085 CloseHandle( m_clrevent ); 00086 #endif 00087 00088 if( m_db != null ) 00089 { 00090 m_callbackpoint.Free(); 00091 m_db = null; 00092 m_callinterface = null; 00093 } 00094 }
GCHandle SQLiteCSLib.Inner.OSQLiteCollation.m_callbackpoint [protected] |
コールバックポインタ
OSQLiteCollation.cs の 15 行で定義されています。
コールバックインターフェース
OSQLiteCollation.cs の 25 行で定義されています。
OSQLiteDBWrap SQLiteCSLib.Inner.OSQLiteCollation.m_db [protected] |
データベース
OSQLiteCollation.cs の 20 行で定義されています。
1.6.1