Inheritance: RealmHandle
Exemplo n.º 1
0
        private static void AddQueryNotEqual(QueryHandle queryHandle, string columnName, object value)
        {
            var columnIndex = queryHandle.GetColumnIndex(columnName);

            if (value == null)
            {
                queryHandle.NullNotEqual(columnIndex);
            }
            else if (value is string)
            {
                queryHandle.StringNotEqual(columnIndex, (string)value, caseSensitive: true);
            }
            else if (value is bool)
            {
                queryHandle.BoolNotEqual(columnIndex, (bool)value);
            }
            else if (value is char)
            {
                queryHandle.IntNotEqual(columnIndex, (int)value);
            }
            else if (value is int)
            {
                queryHandle.IntNotEqual(columnIndex, (int)value);
            }
            else if (value is long)
            {
                queryHandle.LongNotEqual(columnIndex, (long)value);
            }
            else if (value is float)
            {
                queryHandle.FloatNotEqual(columnIndex, (float)value);
            }
            else if (value is double)
            {
                queryHandle.DoubleNotEqual(columnIndex, (double)value);
            }
            else if (value is DateTimeOffset)
            {
                queryHandle.TimestampTicksNotEqual(columnIndex, (DateTimeOffset)value);
            }
            else if (value is byte[])
            {
                var buffer = (byte[])value;
                if (buffer.Length == 0)
                {
                    // see RealmObject.SetByteArrayValue
                    queryHandle.BinaryNotEqual(columnIndex, (IntPtr)0x1, IntPtr.Zero);
                    return;
                }

                unsafe
                {
                    fixed(byte *bufferPtr = (byte[])value)
                    {
                        queryHandle.BinaryNotEqual(columnIndex, (IntPtr)bufferPtr, (IntPtr)buffer.LongLength);
                    }
                }
            }
            else if (value is RealmObject)
            {
                queryHandle.Not();
                queryHandle.ObjectEqual(columnIndex, ((RealmObject)value).ObjectHandle);
            }
            else
            {
                throw new NotImplementedException();
            }
        }
Exemplo n.º 2
0
 public static extern void string_not_equal(QueryHandle queryPtr, IntPtr columnIndex,
                                            [MarshalAs(UnmanagedType.LPWStr)] string value, IntPtr valueLen, out NativeException ex);
Exemplo n.º 3
0
 public static extern void primitive_greater_equal(QueryHandle queryPtr, SharedRealmHandle realm, IntPtr property_ndx, PrimitiveValue primitive, out NativeException ex);
Exemplo n.º 4
0
 public static extern IntPtr create_results(QueryHandle queryPtr, SharedRealmHandle sharedRealm, out NativeException ex);
Exemplo n.º 5
0
 public static extern void double_greater(QueryHandle queryPtr, IntPtr columnIndex, Double value, out NativeException ex);
Exemplo n.º 6
0
 public static extern void query_object_equal(QueryHandle queryPtr, IntPtr columnIndex, ObjectHandle objectHandle, out NativeException ex);
Exemplo n.º 7
0
 public static extern IntPtr get_column_index(QueryHandle queryPtr,
                                              [MarshalAs(UnmanagedType.LPWStr)] string columnName, IntPtr columnNameLen, out NativeException ex);
Exemplo n.º 8
0
 public static extern IntPtr get_column_index(QueryHandle queryPtr,
             [MarshalAs(UnmanagedType.LPWStr)] string columnName, IntPtr columnNameLen, out NativeException ex);
Exemplo n.º 9
0
 public static extern void group_end(QueryHandle queryHandle, out NativeException ex);
Exemplo n.º 10
0
 public static extern IntPtr findDirect(QueryHandle queryHandle, IntPtr beginAtIndex, SharedRealmHandle realmHandle, out NativeException ex);
Exemplo n.º 11
0
 public static extern IntPtr findNext(QueryHandle queryHandle, ObjectHandle previousObject, out NativeException ex);
Exemplo n.º 12
0
 public static extern void null_equal(QueryHandle queryPtr, IntPtr columnIndex, out NativeException ex);
Exemplo n.º 13
0
 public static extern void query_object_equal(QueryHandle queryPtr, IntPtr columnIndex, ObjectHandle objectHandle, out NativeException ex);
Exemplo n.º 14
0
 public static extern void timestamp_ticks_greater_equal(QueryHandle queryPtr, IntPtr columnIndex, Int64 value, out NativeException ex);
Exemplo n.º 15
0
 public static extern void long_greater(QueryHandle queryPtr, IntPtr columnIndex, Int64 value, out NativeException ex);
Exemplo n.º 16
0
 public static extern void or(QueryHandle queryHandle, out NativeException ex);
Exemplo n.º 17
0
 public static extern void double_greater_equal(QueryHandle queryPtr, IntPtr columnIndex, Double value, out NativeException ex);
Exemplo n.º 18
0
 public static extern IntPtr count(QueryHandle QueryHandle, out NativeException ex);
Exemplo n.º 19
0
 public static extern IntPtr findDirect(QueryHandle queryHandle, IntPtr beginAtIndex, SharedRealmHandle realmHandle, out NativeException ex);
Exemplo n.º 20
0
 public static extern IntPtr create_results(QueryHandle queryPtr, SharedRealmHandle sharedRealm, out NativeException ex);
Exemplo n.º 21
0
 public static extern void or(QueryHandle queryHandle, out NativeException ex);
Exemplo n.º 22
0
 public static extern IntPtr create_sorted_results(QueryHandle queryPtr, SharedRealmHandle sharedRealm, TableHandle tablePtr,
     [MarshalAs(UnmanagedType.LPArray), In]SortDescriptorBuilder.Clause.Marshalable[] sortClauses, IntPtr clauseCount,
     [MarshalAs(UnmanagedType.LPArray), In]IntPtr[] flattenedPropertyIndices,
     out NativeException ex);
Exemplo n.º 23
0
 public static extern void binary_not_equal(QueryHandle queryPtr, IntPtr columnIndex, IntPtr buffer, IntPtr bufferLength, out NativeException ex);
Exemplo n.º 24
0
 public static extern void binary_not_equal(QueryHandle queryPtr, IntPtr columnIndex, IntPtr buffer, IntPtr bufferLength, out NativeException ex);
Exemplo n.º 25
0
 public static extern IntPtr findDirect(QueryHandle queryHandle, IntPtr beginAtRow, out NativeException ex);
Exemplo n.º 26
0
 public static extern void string_not_equal(QueryHandle queryPtr, IntPtr columnIndex,
             [MarshalAs(UnmanagedType.LPWStr)] string value, IntPtr valueLen, [MarshalAs(UnmanagedType.I1)] bool caseSensitive, out NativeException ex);
Exemplo n.º 27
0
 public static extern void string_like(QueryHandle queryPtr, SharedRealmHandle realm, IntPtr property_ndx,
                                       PrimitiveValue primitive, [MarshalAs(UnmanagedType.U1)] bool caseSensitive, out NativeException ex);
Exemplo n.º 28
0
 public static extern void bool_not_equal(QueryHandle queryPtr, IntPtr columnIndex, IntPtr value, out NativeException ex);
Exemplo n.º 29
0
 public static extern void null_not_equal(QueryHandle queryPtr, SharedRealmHandle realm, IntPtr property_ndx, out NativeException ex);
Exemplo n.º 30
0
 public static extern void int_greater_equal(QueryHandle queryPtr, IntPtr columnIndex, IntPtr value, out NativeException ex);
Exemplo n.º 31
0
 public static extern void int_less_equal(QueryHandle queryPtr, IntPtr columnIndex, IntPtr value, out NativeException ex);
Exemplo n.º 32
0
 public static extern void long_less(QueryHandle queryPtr, IntPtr columnIndex, Int64 value, out NativeException ex);
Exemplo n.º 33
0
 public static extern void float_greater(QueryHandle queryPtr, IntPtr columnIndex, Single value, out NativeException ex);
Exemplo n.º 34
0
 internal static extern void int_greater(QueryHandle queryPtr, IntPtr columnIndex, IntPtr value);
Exemplo n.º 35
0
 public static extern void timestamp_ticks_greater_equal(QueryHandle queryPtr, IntPtr columnIndex, Int64 value, out NativeException ex);
Exemplo n.º 36
0
 internal static extern void long_less(QueryHandle queryPtr, IntPtr columnIndex, Int64 value);
Exemplo n.º 37
0
 public static extern void null_not_equal(QueryHandle queryPtr, IntPtr columnIndex, out NativeException ex);
Exemplo n.º 38
0
 internal static extern void long_greater_equal(QueryHandle queryPtr, IntPtr columnIndex, Int64 value);
Exemplo n.º 39
0
 public static extern IntPtr findNext(QueryHandle queryHandle, ObjectHandle previousObject, out NativeException ex);
Exemplo n.º 40
0
        private static void AddQueryNotEqual(QueryHandle queryHandle, string columnName, object value)
        {
            var columnIndex = queryHandle.GetColumnIndex(columnName);

            switch (value)
            {
            case null:
                queryHandle.NullNotEqual(columnIndex);
                break;

            case string stringValue:
                queryHandle.StringNotEqual(columnIndex, stringValue, caseSensitive: true);
                break;

            case bool boolValue:
                queryHandle.BoolNotEqual(columnIndex, boolValue);
                break;

            case char charValue:
                queryHandle.IntNotEqual(columnIndex, charValue);
                break;

            case byte byteValue:
                queryHandle.IntNotEqual(columnIndex, byteValue);
                break;

            case short shortValue:
                queryHandle.IntNotEqual(columnIndex, shortValue);
                break;

            case int intValue:
                queryHandle.IntNotEqual(columnIndex, intValue);
                break;

            case long longValue:
                queryHandle.LongNotEqual(columnIndex, longValue);
                break;

            case float floatValue:
                queryHandle.FloatNotEqual(columnIndex, floatValue);
                break;

            case double doubleValue:
                queryHandle.DoubleNotEqual(columnIndex, doubleValue);
                break;

            case DateTimeOffset date:
                queryHandle.TimestampTicksNotEqual(columnIndex, date);
                break;

            case byte[] buffer:
                if (buffer.Length == 0)
                {
                    // see RealmObject.SetByteArrayValue
                    queryHandle.BinaryNotEqual(columnIndex, (IntPtr)0x1, IntPtr.Zero);
                    return;
                }

                unsafe
                {
                    fixed(byte *bufferPtr = (byte[])value)
                    {
                        queryHandle.BinaryNotEqual(columnIndex, (IntPtr)bufferPtr, (IntPtr)buffer.LongCount());
                    }
                }
                break;

            case RealmObject obj:
                queryHandle.Not();
                queryHandle.ObjectEqual(columnIndex, obj.ObjectHandle);
                break;

            case RealmInteger <byte> byteValue:
                queryHandle.IntNotEqual(columnIndex, byteValue);
                break;

            case RealmInteger <short> shortValue:
                queryHandle.IntNotEqual(columnIndex, shortValue);
                break;

            case RealmInteger <int> intValue:
                queryHandle.IntNotEqual(columnIndex, intValue);
                break;

            case RealmInteger <long> longValue:
                queryHandle.LongNotEqual(columnIndex, longValue);
                break;

            default:
                throw new NotImplementedException();
            }
        }
Exemplo n.º 41
0
 public static extern void group_end(QueryHandle queryHandle, out NativeException ex);
Exemplo n.º 42
0
        private static void AddQueryGreaterThan(QueryHandle queryHandle, string columnName, object value)
        {
            var columnIndex = queryHandle.GetColumnIndex(columnName);

            switch (value)
            {
            case char charValue:
                queryHandle.IntGreater(columnIndex, charValue);
                break;

            case byte byteValue:
                queryHandle.IntGreater(columnIndex, byteValue);
                break;

            case short shortValue:
                queryHandle.IntGreater(columnIndex, shortValue);
                break;

            case int intValue:
                queryHandle.IntGreater(columnIndex, intValue);
                break;

            case long longValue:
                queryHandle.LongGreater(columnIndex, longValue);
                break;

            case float floatValue:
                queryHandle.FloatGreater(columnIndex, floatValue);
                break;

            case double doubleValue:
                queryHandle.DoubleGreater(columnIndex, doubleValue);
                break;

            case DateTimeOffset date:
                queryHandle.TimestampTicksGreater(columnIndex, date);
                break;

            case string _:
            case bool _:
                throw new Exception($"Unsupported type {value.GetType().Name}");

            case RealmInteger <byte> byteValue:
                queryHandle.IntGreater(columnIndex, byteValue);
                break;

            case RealmInteger <short> shortValue:
                queryHandle.IntGreater(columnIndex, shortValue);
                break;

            case RealmInteger <int> intValue:
                queryHandle.IntGreater(columnIndex, intValue);
                break;

            case RealmInteger <long> longValue:
                queryHandle.LongGreater(columnIndex, longValue);
                break;

            default:
                throw new NotImplementedException();
            }
        }
Exemplo n.º 43
0
 public static extern IntPtr count(QueryHandle QueryHandle, out NativeException ex);
Exemplo n.º 44
0
 public static extern void float_less(QueryHandle queryPtr, IntPtr columnIndex, float value, out NativeException ex);
Exemplo n.º 45
0
 public static extern IntPtr create_sorted_results(QueryHandle queryPtr, SharedRealmHandle sharedRealm, TableHandle tablePtr,
                                                   [MarshalAs(UnmanagedType.LPArray), In] SortDescriptorBuilder.Clause.Marshalable[] sortClauses, IntPtr clauseCount,
                                                   [MarshalAs(UnmanagedType.LPArray), In] IntPtr[] flattenedPropertyIndices,
                                                   out NativeException ex);
Exemplo n.º 46
0
 public static extern void double_less(QueryHandle queryPtr, IntPtr columnIndex, double value, out NativeException ex);
Exemplo n.º 47
0
 public static extern void string_ends_with(QueryHandle queryPtr, IntPtr columnIndex,
                                            [MarshalAs(UnmanagedType.LPWStr)] string value, IntPtr valueLen, [MarshalAs(UnmanagedType.I1)] bool caseSensitive, out NativeException ex);
Exemplo n.º 48
0
 public static extern void float_greater(QueryHandle queryPtr, IntPtr columnIndex, Single value, out NativeException ex);