示例#1
0
 public DatabaseConfig(DbFlags flags,
                       CompareFunction compareFunc = null,
                       CompareFunction dupSortFunc = null)
 {
     OpenFlags       = flags;
     CompareFunction = compareFunc;
     DupSortFunction = dupSortFunc;
 }
示例#2
0
 public static extern int mdb_dbi_open(IntPtr txn, string name, DbFlags flags, out uint db);
示例#3
0
        private void InitFlags()
        {
            DbFlags initFlags = DbFlags.None;

            if (dbFlagCollection == null)
            {
                return;
            }
            foreach (DatabaseFlags flag in dbFlagCollection)
            {
                switch (flag)
                {
                case DatabaseFlags.None:
                    initFlags |= DbFlags.None;
                    break;

                case DatabaseFlags.ChkSum:
                    initFlags |= DbFlags.ChkSum;
                    break;

                case DatabaseFlags.Dup:
                    initFlags |= DbFlags.Dup;
                    break;

                case DatabaseFlags.DupSort:
                    initFlags |= DbFlags.DupSort;
                    break;

                case DatabaseFlags.Encrypt:
                    initFlags |= DbFlags.Encrypt;
                    break;

                case DatabaseFlags.InOrder:
                    initFlags |= DbFlags.InOrder;
                    break;

                case DatabaseFlags.RecNum:
                    initFlags |= DbFlags.RecNum;
                    break;

                case DatabaseFlags.Renumber:
                    initFlags |= DbFlags.Renumber;
                    break;

                case DatabaseFlags.RevSplitOff:
                    initFlags |= DbFlags.RevSplitOff;
                    break;

                case DatabaseFlags.Snapshot:
                    initFlags |= DbFlags.Snapshot;
                    break;

                case DatabaseFlags.TxnNotDurable:
                    initFlags |= DbFlags.TxnNotDurable;
                    break;

                default:
                    throw new ApplicationException("Unknown DB Flag '" + flag + "'");
                }

                flags = initFlags;
            }
        }