private (MDBResultCode resultCode, MDBValue key, MDBValue value) Get(CursorOperation operation)
        {
            var mdbKey   = new MDBValue();
            var mdbValue = new MDBValue();

            return(mdb_cursor_get(_handle, ref mdbKey, ref mdbValue, operation), mdbKey, mdbValue);
        }
예제 #2
0
        private bool Get(CursorOperation operation)
        {
            _currentKeyStructure   = default(ValueStructure);
            _currentValueStructure = default(ValueStructure);

            return(Lmdb.mdb_cursor_get(_handle, out _currentKeyStructure, out _currentValueStructure, operation) == 0);
        }
예제 #3
0
        //TODO: tests
        private KeyValuePair <byte[], byte[]> Get(CursorOperation operation, ValueStructure?key = null, ValueStructure?value = null)
        {
            var keyStruct   = key.GetValueOrDefault();
            var valueStruct = value.GetValueOrDefault();

            var res = Native.Read(() => Native.mdb_cursor_get(_handle, ref keyStruct, ref valueStruct, operation));

            return(new KeyValuePair <byte[], byte[]>(keyStruct.ToByteArray(res), valueStruct.ToByteArray(res)));
        }
        private (MDBResultCode resultCode, MDBValue key, MDBValue value) Get(CursorOperation operation, byte[] key)
        {
            if (key is null)
            {
                throw new ArgumentNullException(nameof(key));
            }

            return(Get(operation, key.AsSpan()));
        }
        private unsafe (MDBResultCode resultCode, MDBValue key, MDBValue value) Get(CursorOperation operation, ReadOnlySpan <byte> key)
        {
            fixed(byte *keyPtr = key)
            {
                var mdbKey   = new MDBValue(key.Length, keyPtr);
                var mdbValue = new MDBValue();

                return(mdb_cursor_get(_handle, ref mdbKey, ref mdbValue, operation), mdbKey, mdbValue);
            }
        }
예제 #6
0
        private bool Get(CursorOperation operation, byte[] key)
        {
            _currentValueStructure = default(ValueStructure);
            var found = mdb_cursor_get(_handle, key, out _currentKeyStructure, out _currentValueStructure, operation) == 0;

            if (found)
            {
                _getCurrent = _currentDefault;
            }
            return(found);
        }
예제 #7
0
        private KeyValuePair <byte[], byte[]>?Get(CursorOperation operation, ValueStructure?key = null, ValueStructure?value = null)
        {
            var keyStruct   = key.GetValueOrDefault();
            var valueStruct = value.GetValueOrDefault();

            var res = NativeMethods.Read(lib => lib.mdb_cursor_get(_handle, ref keyStruct, ref valueStruct, operation));

            return(res == NativeMethods.MDB_NOTFOUND
                ? (KeyValuePair <byte[], byte[]>?)null
                : new KeyValuePair <byte[], byte[]>(keyStruct.ToByteArray(res), valueStruct.ToByteArray(res)));
        }
예제 #8
0
        private bool Get(CursorOperation operation, byte[] key, byte[] value)
        {
            var found = mdb_cursor_get(_handle, key, value, operation) == 0;

            if (found)
            {
                _getCurrent  = _currentWithOptimizedPair;
                _currentPair = new KeyValuePair <byte[], byte[]>(key, value);
            }
            return(found);
        }
예제 #9
0
        private bool GetMultiple(CursorOperation operation)
        {
            byte[] key;
            byte[] value;
            var    found = mdb_cursor_get(_handle, out key, out value, ref _currentKeyStructure, ref _currentValueStructure, operation) == 0;

            if (found)
            {
                _currentPair = new KeyValuePair <byte[], byte[]>(key, value);
                _getCurrent  = _currentWithOptimizedPair;
            }
            return(found);
        }
예제 #10
0
        //TODO: tests
        private KeyValuePair<byte[], byte[]> Get(CursorOperation operation, ValueStructure? key = null, ValueStructure? value = null)
        {
            var keyStruct = key.GetValueOrDefault();
            var valueStruct = value.GetValueOrDefault();

            var res = Native.Read(lib => lib.mdb_cursor_get(_handle, ref keyStruct, ref valueStruct, operation));

            return new KeyValuePair<byte[], byte[]>(keyStruct.ToByteArray(res), valueStruct.ToByteArray(res));
        }
예제 #11
0
 private static extern int mdb_cursor_get(IntPtr cursor, ref ValueStructure key, ref ValueStructure data, CursorOperation op);
 internal ArangoQueryOperation(CursorOperation cursorOperation, List <Etom> expressionTree)
 {
     _cursorOperation = cursorOperation;
     ExpressionTree.AddRange(expressionTree);
 }
 internal ArangoQueryOperation(CursorOperation cursorOperation)
 {
     _cursorOperation = cursorOperation;
 }
예제 #14
0
 public static int mdb_cursor_get(IntPtr cursor, byte[] key, byte[] value, CursorOperation op)
 {
     using(var marshal = new MarshalValueStructure(key, value))
         return checkRead(LmdbMethods.mdb_cursor_get(cursor, ref marshal.Key, ref marshal.Value, op));
 }
예제 #15
0
 public static extern int mdb_cursor_get(IntPtr cursor, ref ValueStructure key, ref ValueStructure data, CursorOperation op);
 int INativeLibraryFacade.mdb_cursor_get(IntPtr cursor, ref ValueStructure key, ref ValueStructure data, CursorOperation op)
 {
     return(FallbackLibraryFacade.mdb_cursor_get(cursor, ref key, ref data, op));
 }
예제 #17
0
 public static int mdb_cursor_get(IntPtr cursor, byte[] key, byte[] value, CursorOperation op)
 {
     using (var marshal = new MarshalValueStructure(key, value))
         return(checkRead(LmdbMethods.mdb_cursor_get(cursor, ref marshal.Key, ref marshal.Value, op)));
 }
예제 #18
0
 public static MDBResultCode mdb_cursor_get(IntPtr cursor, ref MDBValue key, ref MDBValue value, CursorOperation op)
 {
     return(LmdbMethods.mdb_cursor_get(cursor, ref key, ref value, op));
 }
예제 #19
0
 private bool Get(CursorOperation operation, byte[] key, byte[] value)
 {
     return(Lmdb.mdb_cursor_get(_handle, key, value, operation) == 0);
 }
예제 #20
0
 public static int mdb_cursor_get_multiple(IntPtr cursor, ref ValueStructure key, ref ValueStructure value, CursorOperation op)
 {
     return(checkRead(LmdbMethods.mdb_cursor_get(cursor, ref key, ref value, op)));
 }
예제 #21
0
 public static int mdb_cursor_get(IntPtr cursor, out byte[] key, out byte[] value, ref ValueStructure keyStructure, ref ValueStructure valueStructure, CursorOperation op)
 {
     key = value = null;
     var result = checkRead(LmdbMethods.mdb_cursor_get(cursor, ref keyStructure, ref valueStructure, op));
     if (result == 0)
     {
         key = keyStructure.GetBytes();
         value = valueStructure.GetBytes();
     }
     return result;
 }
예제 #22
0
 public static int mdb_cursor_get(IntPtr cursor, out ValueStructure key, out ValueStructure value, CursorOperation op)
 {
     key = value = default(ValueStructure);
     return checkRead(LmdbMethods.mdb_cursor_get(cursor, ref key, ref value, op));
 }
예제 #23
0
 int INativeLibraryFacade.mdb_cursor_get(IntPtr cursor, ref ValueStructure key, ref ValueStructure data, CursorOperation op)
 {
     return FallbackLibraryFacade.mdb_cursor_get(cursor, ref key, ref data, op);
 }
예제 #24
0
        public static int mdb_cursor_get(IntPtr cursor, out byte[] key, out byte[] value, ref ValueStructure keyStructure, ref ValueStructure valueStructure, CursorOperation op)
        {
            key = value = null;
            var result = checkRead(LmdbMethods.mdb_cursor_get(cursor, ref keyStructure, ref valueStructure, op));

            if (result == 0)
            {
                key   = keyStructure.GetBytes();
                value = valueStructure.GetBytes();
            }
            return(result);
        }
예제 #25
0
 public static int mdb_cursor_get(IntPtr cursor, byte[] key, out ValueStructure keyStructure, out ValueStructure valueStructure, CursorOperation op)
 {
     valueStructure = default(ValueStructure);
     using (var marshal = new MarshalValueStructure(key))
     {
         keyStructure = marshal.Key;
         return(checkRead(LmdbMethods.mdb_cursor_get(cursor, ref keyStructure, ref valueStructure, op)));
     }
 }
예제 #26
0
 public static extern MDBResultCode mdb_cursor_get(IntPtr cursor, ref MDBValue key, ref MDBValue data, CursorOperation op);
예제 #27
0
 public static int mdb_cursor_get(IntPtr cursor, out ValueStructure key, out ValueStructure value, CursorOperation op)
 {
     key = value = default(ValueStructure);
     return(checkRead(LmdbMethods.mdb_cursor_get(cursor, ref key, ref value, op)));
 }
예제 #28
0
 public static int mdb_cursor_get(IntPtr cursor, byte[] key, out ValueStructure keyStructure, out ValueStructure valueStructure, CursorOperation op)
 {
     valueStructure = default(ValueStructure);
     using (var marshal = new MarshalValueStructure(key))
     {
         keyStructure = marshal.Key;
         return checkRead(LmdbMethods.mdb_cursor_get(cursor, ref keyStructure, ref valueStructure, op));
     }
 }
예제 #29
0
 private (MDBResultCode resultCode, MDBValue key, MDBValue value) Get(CursorOperation operation, byte[] key, byte[] value)
 {
     return(Get(operation, key.AsSpan(), value.AsSpan()));
 }
 private bool Get(CursorOperation operation, byte[] key)
 {
     _currentValueStructure = default(ValueStructure);
     return(mdb_cursor_get(_handle, key, out _currentKeyStructure, out _currentValueStructure, operation) == 0);
 }
예제 #31
0
 private bool GetMultiple(CursorOperation operation)
 {
     return(Lmdb.mdb_cursor_get_multiple(_handle, ref _currentKeyStructure, ref _currentValueStructure, operation) == 0);
 }
예제 #32
0
 public static int mdb_cursor_get_multiple(IntPtr cursor, ref ValueStructure key, ref ValueStructure value, CursorOperation op)
 {
     return checkRead(LmdbMethods.mdb_cursor_get(cursor, ref key, ref value, op));
 }