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); }
private bool Get(CursorOperation operation) { _currentKeyStructure = default(ValueStructure); _currentValueStructure = default(ValueStructure); return(Lmdb.mdb_cursor_get(_handle, out _currentKeyStructure, out _currentValueStructure, operation) == 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); } }
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); }
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))); }
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); }
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); }
//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)); }
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; }
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)); }
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)); }
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))); }
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)); }
private bool Get(CursorOperation operation, byte[] key, byte[] value) { return(Lmdb.mdb_cursor_get(_handle, key, value, operation) == 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))); }
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; }
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)); }
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); }
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); }
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))); } }
public static extern MDBResultCode mdb_cursor_get(IntPtr cursor, ref MDBValue key, ref MDBValue data, CursorOperation op);
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))); }
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)); } }
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); }
private bool GetMultiple(CursorOperation operation) { return(Lmdb.mdb_cursor_get_multiple(_handle, ref _currentKeyStructure, ref _currentValueStructure, operation) == 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)); }