本文整理汇总了C#中BerkeleyDB.Internal.DB类的典型用法代码示例。如果您正苦于以下问题:C# DB类的具体用法?C# DB怎么用?C# DB使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DB类属于BerkeleyDB.Internal命名空间,在下文中一共展示了DB类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: associate_foreign
internal int associate_foreign(DB dbp, BDB_AssociateForeignDelegate callback, uint flags)
{
int ret;
ret = libdb_csharpPINVOKE.DB_associate_foreign(swigCPtr, DB.getCPtr(dbp), callback, flags);
DatabaseException.ThrowException(ret);
return ret;
}
示例2: BaseDatabase
/// <summary>
/// Create a new database object with the same underlying DB handle as
/// <paramref name="clone"/>. Used during Database.Open to get an
/// object of the correct DBTYPE.
/// </summary>
/// <param name="clone">Database to clone</param>
protected BaseDatabase(BaseDatabase clone) {
db = clone.db;
clone.db = null;
db.api_internal = this;
env = clone.env;
clone.env = null;
}
示例3: associate
internal int associate(DB_TXN txn, DB sec, BDB_AssociateDelegate callback, uint flags)
{
int ret;
ret = libdb_csharpPINVOKE.DB_associate(swigCPtr, DB_TXN.getCPtr(txn), DB.getCPtr(sec), callback, flags);
DatabaseException.ThrowException(ret);
return ret;
}
示例4: doDupCompare
private static int doDupCompare(
IntPtr dbp, IntPtr dbt1p, IntPtr dbt2p, IntPtr locp)
{
DB db = new DB(dbp, false);
DBT dbt1 = new DBT(dbt1p, false);
DBT dbt2 = new DBT(dbt2p, false);
if (locp != IntPtr.Zero)
locp = IntPtr.Zero;
return ((SecondaryBTreeDatabase)(db.api_internal)).DupCompare(
DatabaseEntry.fromDBT(dbt1), DatabaseEntry.fromDBT(dbt2));
}
示例5: doPrefixCompare
private static uint doPrefixCompare(
IntPtr dbp, IntPtr dbtp1, IntPtr dbtp2)
{
DB db = new DB(dbp, false);
DBT dbt1 = new DBT(dbtp1, false);
DBT dbt2 = new DBT(dbtp2, false);
SecondaryBTreeDatabase tmp =
(SecondaryBTreeDatabase)db.api_internal;
return tmp.prefixCompareHandler(
DatabaseEntry.fromDBT(dbt1), DatabaseEntry.fromDBT(dbt2));
}
示例6: doHash
private static uint doHash(IntPtr dbp, IntPtr datap, uint len)
{
DB db = new DB(dbp, false);
byte[] t_data = new byte[len];
Marshal.Copy(datap, t_data, 0, (int)len);
SecondaryHashDatabase tmp = (SecondaryHashDatabase)db.api_internal;
return tmp.HashFunction(t_data);
}
示例7: doCompare
private static int doCompare(IntPtr dbp,
IntPtr dbtp1, IntPtr dbtp2, IntPtr locp)
{
DB db = new DB(dbp, false);
DBT dbt1 = new DBT(dbtp1, false);
DBT dbt2 = new DBT(dbtp2, false);
if (locp != IntPtr.Zero)
locp = IntPtr.Zero;
SecondaryBTreeDatabase tmp =
(SecondaryBTreeDatabase)db.api_internal;
return tmp.compareHandler(
DatabaseEntry.fromDBT(dbt1), DatabaseEntry.fromDBT(dbt2));
}
示例8: doCompare
private static int doCompare(IntPtr dbp,
IntPtr dbtp1, IntPtr dbtp2, IntPtr locp)
{
DB db = new DB(dbp, false);
DBT dbt1 = new DBT(dbtp1, false);
DBT dbt2 = new DBT(dbtp2, false);
if (locp != IntPtr.Zero)
locp = IntPtr.Zero;
BTreeDatabase btdb = (BTreeDatabase)(db.api_internal);
return btdb.Compare(
DatabaseEntry.fromDBT(dbt1), DatabaseEntry.fromDBT(dbt2));
}
示例9: doDupCompare
private static int doDupCompare(
IntPtr dbp, IntPtr dbt1p, IntPtr dbt2p)
{
DB db = new DB(dbp, false);
DBT dbt1 = new DBT(dbt1p, false);
DBT dbt2 = new DBT(dbt2p, false);
BTreeDatabase btdb = (BTreeDatabase)(db.api_internal);
return btdb.DupCompare(
DatabaseEntry.fromDBT(dbt1), DatabaseEntry.fromDBT(dbt2));
}
示例10: doDupCompare
private static int doDupCompare(
IntPtr dbp, IntPtr dbt1p, IntPtr dbt2p)
{
DB db = new DB(dbp, false);
DBT dbt1 = new DBT(dbt1p, false);
DBT dbt2 = new DBT(dbt2p, false);
SecondaryHashDatabase tmp = (SecondaryHashDatabase)db.api_internal;
return tmp.DupCompare(
DatabaseEntry.fromDBT(dbt1), DatabaseEntry.fromDBT(dbt2));
}
示例11: doNullify
/// <summary>
/// Protected method to nullify a foreign key
/// </summary>
/// <param name="dbp">Secondary DB Handle</param>
/// <param name="keyp">Primary Key</param>
/// <param name="datap">Primary Data</param>
/// <param name="fkeyp">Foreign Key</param>
/// <param name="changed">Whether the foreign key has changed</param>
/// <returns>0 on success, !0 on failure</returns>
protected static int doNullify(IntPtr dbp,
IntPtr keyp, IntPtr datap, IntPtr fkeyp, ref int changed) {
DB db = new DB(dbp, false);
DBT key = new DBT(keyp, false);
DBT data = new DBT(datap, false);
DBT fkey = new DBT(fkeyp, false);
DatabaseEntry d = ((SecondaryDatabase)db.api_internal).Nullifier(
DatabaseEntry.fromDBT(key),
DatabaseEntry.fromDBT(data), DatabaseEntry.fromDBT(fkey));
if (d == null)
changed = 0;
else {
changed = 1;
data.data = d.Data;
}
return 0;
}
示例12: doHash
private static uint doHash(IntPtr dbp, IntPtr datap, uint len)
{
DB db = new DB(dbp, false);
byte[] t_data = new byte[len];
Marshal.Copy(datap, t_data, 0, (int)len);
return ((HashDatabase)(db.api_internal)).hashHandler(t_data);
}
示例13: doFeedback
private static void doFeedback(IntPtr dbp, int opcode, int percent)
{
DB db = new DB(dbp, false);
db.api_internal.Feedback((DatabaseFeedbackEvent)opcode, percent);
}
示例14: doCompare
private static int doCompare(IntPtr dbp, IntPtr dbtp1, IntPtr dbtp2)
{
DB db = new DB(dbp, false);
DBT dbt1 = new DBT(dbtp1, false);
DBT dbt2 = new DBT(dbtp2, false);
return ((HashDatabase)(db.api_internal)).compareHandler(
DatabaseEntry.fromDBT(dbt1), DatabaseEntry.fromDBT(dbt2));
}
示例15: doAssociate
/// <summary>
/// Protected method to call the key generation function.
/// </summary>
/// <param name="dbp">Secondary DB Handle</param>
/// <param name="keyp">Primary Key</param>
/// <param name="datap">Primary Data</param>
/// <param name="skeyp">Scondary Key</param>
/// <returns>0 on success, !0 on failure</returns>
protected static int doAssociate(
IntPtr dbp, IntPtr keyp, IntPtr datap, IntPtr skeyp)
{
DB db = new DB(dbp, false);
DBT key = new DBT(keyp, false);
DBT data = new DBT(datap, false);
DBT skey = new DBT(skeyp, false);
DatabaseEntry s =
((SecondaryDatabase)db.api_internal).KeyGen(
DatabaseEntry.fromDBT(key), DatabaseEntry.fromDBT(data));
if (s == null)
return DbConstants.DB_DONOTINDEX;
skey.data = s.Data;
return 0;
}