public static String ToStringEx(this BerkeleyDbCursorFlags flags) { if (flags == 0) { return("0"); } var stringFlags = new StringBuilder(); if ((flags & BerkeleyDbCursorFlags.DB_CURSOR_BULK) != 0) { stringFlags.Append("db_cursor_bulk,"); } if ((flags & BerkeleyDbCursorFlags.DB_READ_COMMITTED) != 0) { stringFlags.Append("db_read_committed,"); } if ((flags & BerkeleyDbCursorFlags.DB_READ_UNCOMMITTED) != 0) { stringFlags.Append("db_read_uncommitted,"); } if ((flags & BerkeleyDbCursorFlags.DB_TXN_SNAPSHOT) != 0) { stringFlags.Append("db_txn_snapshot,"); } if ((flags & BerkeleyDbCursorFlags.DB_WRITECURSOR) != 0) { stringFlags.Append("db_writecursor,"); } stringFlags.Length--; return(stringFlags.ToString()); }
protected BerkeleyCursor(BerkeleyDb berkeleyDb, int bufferSize, BerkeleyDbCursorFlags mandatoryFlags) { _berkeleyDb = berkeleyDb; _bufferSize = bufferSize; _mandatoryFlags = mandatoryFlags; _handle = InvalidHandle; _methods = berkeleyDb.Methods.CreateCursorMethods(); }
protected BerkeleyCursor(BerkeleyDb berkeleyDb, int bufferSize, BerkeleyDbCursorFlags mandatoryFlags) { _berkeleyDb = berkeleyDb; _bufferSize = bufferSize; _mandatoryFlags = mandatoryFlags; _handle = InvalidHandle; _methods = berkeleyDb.Methods.CreateCursorMethods(); }
public static BerkeleyDbCursorFlags CursorFlags(String flags) { BerkeleyDbCursorFlags value = 0; foreach (String flag in flags.Split(',')) { value |= (BerkeleyDbCursorFlags)Enum.Parse(typeof(BerkeleyDbCursorFlags), flags, true); } return(value); }
public BerkeleyDtoResult OpenCursor([FromUri] ulong handle, [FromUri] String flags) { DbHandle db = GetDb(handle); BerkeleyDbCursorFlags cursorFlags = flags == null ? 0 : BerkeleyEnumParser.CursorFlags(flags); ulong cursorHandle = 0; IntPtr pdbc; BerkeleyDbError error = BDbcMethods.Create(BDbOffsetOfInstance.Instance, db.Handle, db.Methods.DbType, cursorFlags, out pdbc); if (error == 0) { DbcHandle dbc = new DbcHandle(pdbc, BDbcMethods.GetMethods(db.Methods.DbType)); cursorHandle = DbcInstance.AddDbc(dbc); if (cursorHandle == 0) { dbc.Methods.Close(dbc.Handle); throw new HttpResponseException(HttpStatusCode.InternalServerError); } } return(new BerkeleyDtoResult(error, cursorHandle.ToString())); }
public BerkeleyDbError Cursor(IntPtr pdb, BerkeleyDbCursorFlags flags, out IntPtr pdbc) { return (BerkeleyDbError)_cursor(pdb, IntPtr.Zero, out pdbc, 0); }
public static BerkeleyDbError Create(BDbOffsetOf offsetOf, IntPtr pdb, BerkeleyDbType dbType, BerkeleyDbCursorFlags flags, out IntPtr pdbc) { BDbMethods dbMethods = BDbMethods.GetMethods(dbType); BerkeleyDbError error = dbMethods.Cursor(pdb, flags, out pdbc); if (error == 0) CreateMethods(dbType, pdbc, offsetOf); return error; }
public abstract Task <BerkeleyResult <long> > OpenCursorAsync(BerkeleyDb db, BerkeleyDbCursorFlags flags);
public abstract Task<BerkeleyResult<long>> OpenCursorAsync(BerkeleyDb db, BerkeleyDbCursorFlags flags);
public static BerkeleyDbError Create(BDbOffsetOf offsetOf, IntPtr pdb, BerkeleyDbType dbType, BerkeleyDbCursorFlags flags, out IntPtr pdbc) { BDbMethods dbMethods = BDbMethods.GetMethods(dbType); BerkeleyDbError error = dbMethods.Cursor(pdb, flags, out pdbc); if (error == 0) { CreateMethods(dbType, pdbc, offsetOf); } return(error); }
public override async Task<BerkeleyResult<long>> OpenCursorAsync(BerkeleyDb db, BerkeleyDbCursorFlags flags) { String requestUri = "api/database/opencursor/?handle=" + db.Handle.ToString() + "&flags=" + flags.ToStringEx(); HttpResponseMessage response = await _httpClient.GetAsync(requestUri).ConfigureAwait(false); if (!response.IsSuccessStatusCode) return new BerkeleyResult<long>(response.StatusCode); BerkeleyDtoResult result = await SerializeHelper.GetResultAsync(_serializer, response.Content).ConfigureAwait(false); if (result.Error != 0) return new BerkeleyResult<long>(result.Error); return new BerkeleyResult<long>(0, Int64.Parse(result.Result)); }
public override async Task <BerkeleyResult <long> > OpenCursorAsync(BerkeleyDb db, BerkeleyDbCursorFlags flags) { String requestUri = "api/database/opencursor/?handle=" + db.Handle.ToString() + "&flags=" + flags.ToStringEx(); HttpResponseMessage response = await _httpClient.GetAsync(requestUri).ConfigureAwait(false); if (!response.IsSuccessStatusCode) { return(new BerkeleyResult <long>(response.StatusCode)); } BerkeleyDtoResult result = await SerializeHelper.GetResultAsync(_serializer, response.Content).ConfigureAwait(false); if (result.Error != 0) { return(new BerkeleyResult <long>(result.Error)); } return(new BerkeleyResult <long>(0, Int64.Parse(result.Result))); }
public BerkeleyDbError Cursor(IntPtr pdb, BerkeleyDbCursorFlags flags, out IntPtr pdbc) { return((BerkeleyDbError)_cursor(pdb, IntPtr.Zero, out pdbc, 0)); }