summaryrefslogtreecommitdiff
path: root/lang/csharp/src/Internal/DB_STREAM.cs
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@baserock.org>2015-02-17 17:25:57 +0000
committer <>2015-03-17 16:26:24 +0000
commit780b92ada9afcf1d58085a83a0b9e6bc982203d1 (patch)
tree598f8b9fa431b228d29897e798de4ac0c1d3d970 /lang/csharp/src/Internal/DB_STREAM.cs
parent7a2660ba9cc2dc03a69ddfcfd95369395cc87444 (diff)
downloadberkeleydb-master.tar.gz
Imported from /home/lorry/working-area/delta_berkeleydb/db-6.1.23.tar.gz.HEADdb-6.1.23master
Diffstat (limited to 'lang/csharp/src/Internal/DB_STREAM.cs')
-rw-r--r--lang/csharp/src/Internal/DB_STREAM.cs88
1 files changed, 88 insertions, 0 deletions
diff --git a/lang/csharp/src/Internal/DB_STREAM.cs b/lang/csharp/src/Internal/DB_STREAM.cs
new file mode 100644
index 00000000..fef9da68
--- /dev/null
+++ b/lang/csharp/src/Internal/DB_STREAM.cs
@@ -0,0 +1,88 @@
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace BerkeleyDB.Internal {
+
+using System;
+using System.Runtime.InteropServices;
+
+internal class DB_STREAM : IDisposable {
+ private HandleRef swigCPtr;
+ protected bool swigCMemOwn;
+
+ internal DB_STREAM(IntPtr cPtr, bool cMemoryOwn) {
+ swigCMemOwn = cMemoryOwn;
+ swigCPtr = new HandleRef(this, cPtr);
+ }
+
+ internal static HandleRef getCPtr(DB_STREAM obj) {
+ return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+ }
+
+ ~DB_STREAM() {
+ Dispose();
+ }
+
+ public virtual void Dispose() {
+ lock(this) {
+ if (swigCPtr.Handle != IntPtr.Zero) {
+ if (swigCMemOwn) {
+ swigCMemOwn = false;
+ libdb_csharpPINVOKE.delete_DB_STREAM(swigCPtr);
+ }
+ swigCPtr = new HandleRef(null, IntPtr.Zero);
+ }
+ GC.SuppressFinalize(this);
+ }
+ }
+
+ internal int close(uint flags) {
+ int ret = libdb_csharpPINVOKE.DB_STREAM_close(swigCPtr, flags);
+ if (ret == 0)
+ /* Close is a db handle destructor. Reflect that in the wrapper class. */
+ swigCPtr = new HandleRef(null, IntPtr.Zero);
+ else
+ DatabaseException.ThrowException(ret);
+ return ret;
+}
+
+ internal int read(DatabaseEntry data, Int64 offset, uint size, uint flags) {
+ try {
+ int ret;
+ ret = libdb_csharpPINVOKE.DB_STREAM_read(swigCPtr, DBT.getCPtr(DatabaseEntry.getDBT(data)), offset, size, flags);
+ DatabaseException.ThrowException(ret);
+ return ret;
+} finally {
+ GC.KeepAlive(data);
+ }
+ }
+
+ internal int size(ref Int64 size, uint flags) {
+ int ret;
+ ret = libdb_csharpPINVOKE.DB_STREAM_size(swigCPtr, ref size, flags);
+ DatabaseException.ThrowException(ret);
+ return ret;
+}
+
+ internal int write(DatabaseEntry data, Int64 offset, uint flags) {
+ try {
+ int ret;
+ ret = libdb_csharpPINVOKE.DB_STREAM_write(swigCPtr, DBT.getCPtr(DatabaseEntry.getDBT(data)), offset, flags);
+ DatabaseException.ThrowException(ret);
+ return ret;
+} finally {
+ GC.KeepAlive(data);
+ }
+ }
+
+ internal DB_STREAM() : this(libdb_csharpPINVOKE.new_DB_STREAM(), true) {
+ }
+
+}
+
+}