Exemple #1
0
        internal static SQLiteValue[] ArrayFromSizeAndIntPtr(int argc, IntPtr argv)
        {
            SQLiteValue sQLiteValue;

            if (argc < 0)
            {
                return(null);
            }
            if (argv == IntPtr.Zero)
            {
                return(null);
            }
            SQLiteValue[] sQLiteValueArray = new SQLiteValue[argc];
            int           num  = 0;
            int           size = 0;

            while (num < (int)sQLiteValueArray.Length)
            {
                IntPtr        intPtr            = SQLiteMarshal.ReadIntPtr(argv, size);
                SQLiteValue[] sQLiteValueArray1 = sQLiteValueArray;
                int           num1 = num;
                if (intPtr != IntPtr.Zero)
                {
                    sQLiteValue = new SQLiteValue(intPtr);
                }
                else
                {
                    sQLiteValue = null;
                }
                sQLiteValueArray1[num1] = sQLiteValue;
                num++;
                size += IntPtr.Size;
            }
            return(sQLiteValueArray);
        }
Exemple #2
0
        public SQLiteValue GetOldValue(int columnIndex)
        {
            this.CheckDisposed();
            this.CheckIterator();
            IntPtr zero = IntPtr.Zero;

            UnsafeNativeMethods.sqlite3changeset_old(this.iterator.GetIntPtr(), columnIndex, ref zero);
            return(SQLiteValue.FromIntPtr(zero));
        }
 public void SetValue(SQLiteValue value)
 {
     if (this.pContext == IntPtr.Zero)
     {
         throw new InvalidOperationException();
     }
     if (value == null)
     {
         throw new ArgumentNullException("value");
     }
     UnsafeNativeMethods.sqlite3_result_value(this.pContext, value.NativeHandle);
 }
        protected virtual int TryPersistValues(SQLiteValue[] values)
        {
            int num = 0;

            if (values != null)
            {
                SQLiteValue[] sQLiteValueArray = values;
                for (int i = 0; i < (int)sQLiteValueArray.Length; i++)
                {
                    SQLiteValue sQLiteValue = sQLiteValueArray[i];
                    if (sQLiteValue != null && sQLiteValue.Persist())
                    {
                        num++;
                    }
                }
            }
            return(num);
        }