CursorErase() private method

private CursorErase ( IntPtr handle, int flags ) : int
handle System.IntPtr
flags int
return int
コード例 #1
0
ファイル: Cursor.cs プロジェクト: venkatarajasekhar/upscaledb
        /// <summary>
        /// Erases the current key
        /// </summary>
        /// <remarks>
        /// This method wraps the native ups_cursor_erase function.
        /// <br />
        /// Erases a key from the Database. If the erase was successfull, the
        /// Cursor is invalidated, and does no longer point to any item.
        /// In case of an error, the Cursor is not modified.
        /// <br />
        /// If the Database was opened with the flag
        /// <see cref="UpsConst.UPS_ENABLE_DUPLICATE_KEYS" />, this function erases
        /// only the duplicate item to which the Cursor refers.
        /// </remarks>
        /// <exception cref="DatabaseException">
        ///   <list type="bullet">
        ///   <item><see cref="UpsConst.UPS_CURSOR_IS_NIL"/>
        ///     if the Cursor does not point to any item</item>
        ///   <item><see cref="UpsConst.UPS_WRITE_PROTECTED"/>
        ///     if you tried to erase a key from a read-only Database</item>
        ///   </list>
        /// </exception>
        public void Erase()
        {
            int st;

            lock (db) {
                st = NativeMethods.CursorErase(handle, 0);
            }
            if (st != 0)
            {
                throw new DatabaseException(st);
            }
        }