Пример #1
0
        internal override int ContextCollateCompare(CollationEncodingEnum enc, IntPtr context, char[] c1, char[] c2)
        {
#if !SQLITE_STANDARD
            byte[] b1;
            byte[] b2;
            System.Text.Encoding converter = null;

            switch (enc)
            {
            case CollationEncodingEnum.UTF8:
                converter = System.Text.Encoding.UTF8;
                break;

            case CollationEncodingEnum.UTF16LE:
                converter = System.Text.Encoding.Unicode;
                break;

            case CollationEncodingEnum.UTF16BE:
                converter = System.Text.Encoding.BigEndianUnicode;
                break;
            }

            b1 = converter.GetBytes(c1);
            b2 = converter.GetBytes(c2);

            return(UnsafeNativeMethods.sqlite3_context_collcompare(context, b1, b1.Length, b2, b2.Length));
#else
            throw new NotImplementedException();
#endif
        }