public static SqliteValueHandle sqlite3_aggregate_context(SqliteContextHandle context, int nBytes) { throw new System.NotImplementedException(); }
        /// <summary>
        /// Takes the return value from Invoke() and Final() and figures out how to return it to SQLite's context.
        /// </summary>
        /// <param name="context">The context the return value applies to</param>
        /// <param name="returnValue">The parameter to return to SQLite</param>
        void SetReturnValue(SqliteContextHandle context, object returnValue) {
            if (returnValue == null || returnValue == DBNull.Value) {
                _base.ReturnNull(context);
                return;
            }

            Type t = returnValue.GetType();
            if (t == typeof(DateTime)) {
                _base.ReturnText(context, _base.ToString((DateTime)returnValue));
                return;
            }
            else {
                Exception r = returnValue as Exception;

                if (r != null) {
                    _base.ReturnError(context, r.Message);
                    return;
                }
            }

            switch (SqliteConvert.TypeToAffinity(t)) {
                case TypeAffinity.Null:
                    _base.ReturnNull(context);
                    return;
                case TypeAffinity.Int64:
                    _base.ReturnInt64(context, Convert.ToInt64(returnValue, CultureInfo.CurrentCulture));
                    return;
                case TypeAffinity.Double:
                    _base.ReturnDouble(context, Convert.ToDouble(returnValue, CultureInfo.CurrentCulture));
                    return;
                case TypeAffinity.Text:
                    _base.ReturnText(context, returnValue.ToString());
                    return;
                case TypeAffinity.Blob:
                    _base.ReturnBlob(context, (byte[])returnValue);
                    return;
            }
        }
        /// <summary>
        /// The internal aggregate Step function callback, which wraps the raw context pointer and calls the virtual Step() method.
        /// </summary>
        /// <remarks>
        /// This function takes care of doing the lookups and getting the important information put together to call the Step() function.
        /// That includes pulling out the user's contextData and updating it after the call is made.  We use a sorted list for this so
        /// binary searches can be done to find the data.
        /// </remarks>
        /// <param name="context">A raw context pointer</param>
        /// <param name="nArgs">Number of arguments passed in</param>
        /// <param name="argsptr">A pointer to the array of arguments</param>
        internal void StepCallback(SqliteContextHandle context, int nArgs, SqliteValueHandle[] argsptr) {
            SqliteValueHandle nAux;
            AggregateData data;

            nAux = (SqliteValueHandle)_base.AggregateContext(context);
            if (_contextDataList.TryGetValue(nAux, out data) == false) {
                data = new AggregateData();
                _contextDataList[nAux] = data;
            }

            try {
                _context = context;
                Step(ConvertParams(nArgs, argsptr), data._count, ref data._data);
            }
            finally {
                data._count++;
            }
        }
 internal abstract void ReturnNull(SqliteContextHandle context);
示例#5
0
 internal abstract void ReturnInt64(SqliteContextHandle context, Int64 value);
 public static void sqlite3_result_text16(SqliteContextHandle statement, string value, int index, object dummy) { throw new System.NotImplementedException(); }
 internal abstract SqliteValueHandle AggregateContext(SqliteContextHandle context);
 public static void sqlite3_result_blob(SqliteContextHandle context, byte[] data, int dataLength, object callback)
 {
     var value = new System.Text.UnicodeEncoding().GetString(data, 0, data.Length);
     Community.CsharpSqlite.Sqlite3.sqlite3_result_blob(context.Handle, value, dataLength, null);
 }
 public static void sqlite3_result_double(SqliteContextHandle context, double value)
 {
     Community.CsharpSqlite.Sqlite3.sqlite3_result_double(context.Handle, value);
 }
示例#10
0
 public static void sqlite3_result_null(SqliteContextHandle statement)
 {
     throw new System.NotImplementedException();
 }
示例#11
0
 public static void sqlite3_result_text16(SqliteContextHandle statement, string value, int index, object dummy)
 {
     throw new System.NotImplementedException();
 }
示例#12
0
 public static void sqlite3_result_int64(SqliteContextHandle statement, long value)
 {
     throw new System.NotImplementedException();
 }
示例#13
0
 public static void sqlite3_result_error(SqliteContextHandle statement, string value, int index)
 {
     throw new System.NotImplementedException();
 }
示例#14
0
 public static void sqlite3_result_double(SqliteContextHandle statement, double value)
 {
     throw new System.NotImplementedException();
 }
 public static void sqlite3_result_double(SqliteContextHandle statement, double value) { throw new System.NotImplementedException(); }
 public static void sqlite3_result_int64(SqliteContextHandle context, long value)
 {
     Community.CsharpSqlite.Sqlite3.sqlite3_result_int64(context.Handle, value);
 }
 public static void sqlite3_result_int64(SqliteContextHandle statement, long value) { throw new System.NotImplementedException(); }
 public static void sqlite3_result_null(SqliteContextHandle context)
 {
     Community.CsharpSqlite.Sqlite3.sqlite3_result_null(context.Handle);
 }
示例#19
0
 internal abstract int ContextCollateCompare(CollationEncodingEnum enc, SqliteContextHandle context, string s1,
                                             string s2);
 public static void sqlite3_result_text(SqliteContextHandle context, string text, int textLength, object callback)
 {
     Community.CsharpSqlite.Sqlite3.sqlite3_result_text(context.Handle, text, textLength, null);
 }
示例#21
0
 internal abstract void ReturnDouble(SqliteContextHandle context, double value);
 public static void sqlite3_result_error(SqliteContextHandle context, string error, int errorLength)
 {
     Community.CsharpSqlite.Sqlite3.sqlite3_result_error(context.Handle, error, errorLength);
 }
示例#23
0
 public static void sqlite3_result_blob(SqliteContextHandle context, byte[] value, int length, object dummy)
 {
     throw new System.NotImplementedException();
 }
 public static SqliteValueHandle sqlite3_aggregate_context(SqliteContextHandle context, int theByte)
 {
     var res = Community.CsharpSqlite.Sqlite3.sqlite3_aggregate_context(context.Handle, theByte);
     if (res == null)
         return null;
     return new SqliteValueHandle(res);
 }
示例#25
0
 internal abstract void ReturnNull(SqliteContextHandle context);
 public static void sqlite3_result_error16(SqliteContextHandle context, string error, int errorLength)
 {
     sqlite3_result_error(context, error, errorLength);
 }
 /// <summary>
 /// Internal scalar callback function, which wraps the raw context pointer and calls the virtual Invoke() method.
 /// </summary>
 /// <param name="context">A raw context pointer</param>
 /// <param name="nArgs">Number of arguments passed in</param>
 /// <param name="argsptr">A pointer to the array of arguments</param>
 internal void ScalarCallback(SqliteContextHandle context, int nArgs, SqliteValueHandle[] argsptr) {
     _context = context;
     SetReturnValue(context, Invoke(ConvertParams(nArgs, argsptr)));
 }
 public static void sqlite3_result_text16(SqliteContextHandle context, string value, int valueLength, object callback)
 {
     sqlite3_result_text(context, value, valueLength, null);
 }
        /// <summary>
        /// An internal aggregate Final function callback, which wraps the context pointer and calls the virtual Final() method.
        /// </summary>
        /// <param name="context">A raw context pointer</param>
        internal void FinalCallback(SqliteContextHandle context) {
            SqliteValueHandle n = (SqliteValueHandle)_base.AggregateContext(context);
            object obj = null;

            if (_contextDataList.ContainsKey(n)) {
                obj = _contextDataList[n]._data;
                _contextDataList.Remove(n);
            }

            _context = context;
            SetReturnValue(context, Final(obj));

            IDisposable disp = obj as IDisposable;
            if (disp != null) disp.Dispose();
        }
示例#30
0
 /// <summary>
 /// Internal scalar callback function, which wraps the raw context pointer and calls the virtual Invoke() method.
 /// </summary>
 /// <param name="context">A raw context pointer</param>
 /// <param name="nArgs">Number of arguments passed in</param>
 /// <param name="argsptr">A pointer to the array of arguments</param>
 internal void ScalarCallback(SqliteContextHandle context, int nArgs, SqliteValueHandle[] argsptr)
 {
     _context = context;
     SetReturnValue(context, Invoke(ConvertParams(nArgs, argsptr)));
 }
 public static void sqlite3_result_blob(SqliteContextHandle context, byte[] value, int length, object dummy) { throw new System.NotImplementedException(); }
示例#32
0
 internal abstract CollationSequence GetCollationSequence(SqliteFunction func, SqliteContextHandle context);
 public static void sqlite3_result_error(SqliteContextHandle statement, string value, int index) { throw new System.NotImplementedException(); }
示例#34
0
 internal abstract int ContextCollateCompare(CollationEncodingEnum enc, SqliteContextHandle context, string s1,
                                             string s2);
 public static void sqlite3_result_null(SqliteContextHandle statement) { throw new System.NotImplementedException(); }
示例#36
0
 internal abstract int ContextCollateCompare(CollationEncodingEnum enc, SqliteContextHandle context, char[] c1,
                                             char[] c2);
示例#37
0
 internal abstract CollationSequence GetCollationSequence(SqliteFunction func, SqliteContextHandle context);
示例#38
0
 internal abstract SqliteValueHandle AggregateContext(SqliteContextHandle context);
示例#39
0
 internal abstract int ContextCollateCompare(CollationEncodingEnum enc, SqliteContextHandle context, char[] c1,
                                             char[] c2);
示例#40
0
 internal abstract void ReturnBlob(SqliteContextHandle context, byte[] value);
示例#41
0
 internal abstract void ReturnBlob(SqliteContextHandle context, byte[] value);
示例#42
0
 internal abstract void ReturnDouble(SqliteContextHandle context, double value);
示例#43
0
 internal abstract void ReturnInt64(SqliteContextHandle context, Int64 value);
示例#44
0
 internal abstract void ReturnError(SqliteContextHandle context, string value);
示例#45
0
 internal abstract void ReturnText(SqliteContextHandle context, string value);
示例#46
0
 public static SqliteValueHandle sqlite3_aggregate_context(SqliteContextHandle context, int nBytes)
 {
     throw new System.NotImplementedException();
 }