クラス SQLiteCSLib.Inner.OSQLiteCollation

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

SQLiteCSLib.Inner.OSQLiteCollationのコラボレーション図
Collaboration graph
[凡例]

すべてのメンバ一覧

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.cs10 行で定義されています。


コンストラクタとデストラクタ

SQLiteCSLib.Inner.OSQLiteCollation.OSQLiteCollation ( OSQLiteDBWrap  db,
ICollationFunction  iCallinterface 
)

コンストラクタ

OSQLiteCollation.cs53 行で定義されています。

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.cs171 行で定義されています。

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.cs101 行で定義されています。

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.cs80 行で定義されています。

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                 }


変数

コールバックポインタ

OSQLiteCollation.cs15 行で定義されています。

コールバックインターフェース

OSQLiteCollation.cs25 行で定義されています。

データベース

OSQLiteCollation.cs20 行で定義されています。


このクラスの説明は次のファイルから生成されました:

SQLite3 Wrap ADO For .Net1.1 or Compact Frameworkに対してTue Jan 12 12:05:13 2010に生成されました。  doxygen 1.6.1