diff options
author | Lorry Tar Creator <lorry-tar-importer@baserock.org> | 2015-02-17 17:25:57 +0000 |
---|---|---|
committer | <> | 2015-03-17 16:26:24 +0000 |
commit | 780b92ada9afcf1d58085a83a0b9e6bc982203d1 (patch) | |
tree | 598f8b9fa431b228d29897e798de4ac0c1d3d970 /lang/csharp/src/DatabaseStreamConfig.cs | |
parent | 7a2660ba9cc2dc03a69ddfcfd95369395cc87444 (diff) | |
download | berkeleydb-master.tar.gz |
Diffstat (limited to 'lang/csharp/src/DatabaseStreamConfig.cs')
-rw-r--r-- | lang/csharp/src/DatabaseStreamConfig.cs | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/lang/csharp/src/DatabaseStreamConfig.cs b/lang/csharp/src/DatabaseStreamConfig.cs new file mode 100644 index 00000000..b42c9889 --- /dev/null +++ b/lang/csharp/src/DatabaseStreamConfig.cs @@ -0,0 +1,58 @@ +/*- + * See the file LICENSE for redistribution information. + * + * Copyright (c) 2013, 2015 Oracle and/or its affiliates. All rights reserved. + * + */ +using System; +using System.Collections.Generic; +using System.Text; +using BerkeleyDB.Internal; + +namespace BerkeleyDB { + /// <summary> + /// A class representing configuration parameters for + /// <see cref="DatabaseStream"/> + /// </summary> + public class DatabaseStreamConfig { + internal bool readOnlyIsSet; + private bool readOnly; + /// <summary> + /// The database stream is read only. + /// </summary> + public bool ReadOnly { + get { + return readOnly; + } + set { + readOnlyIsSet = true; + readOnly = value; + } + } + + /// <summary> + /// True if the database stream syncs the blob on each write. + /// </summary> + public bool SyncPerWrite; + + /// <summary> + /// Instantiate a new DatabaseStreamConfig object. + /// </summary> + public DatabaseStreamConfig() { + readOnly = false; + SyncPerWrite = false; + } + + internal uint flags { + get { + uint ret = 0; + if (readOnlyIsSet) + ret |= readOnly ? DbConstants.DB_STREAM_READ : + DbConstants.DB_STREAM_WRITE; + if (SyncPerWrite) + ret |= DbConstants.DB_STREAM_SYNC_WRITE; + return ret; + } + } + } +} |