2007-12-18 20:39:02 +00:00
|
|
|
#include <db_cxx.h>
|
2007-12-18 19:37:59 +00:00
|
|
|
|
|
|
|
int Dbc::close (void) {
|
|
|
|
DBC *dbc = this;
|
2007-12-21 19:59:31 +00:00
|
|
|
DbEnv *env = (DbEnv*)dbc->dbp->api_internal; // Must grab the env before closing the cursor.
|
2007-12-18 19:37:59 +00:00
|
|
|
int ret = dbc->c_close(dbc);
|
2007-12-21 15:32:21 +00:00
|
|
|
return env->maybe_throw_error(ret);
|
2007-12-18 19:37:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int Dbc::get(Dbt* key, Dbt *data, u_int32_t flags) {
|
|
|
|
DBC *dbc = this;
|
|
|
|
int ret = dbc->c_get(dbc, key, data, flags);
|
2007-12-21 20:39:53 +00:00
|
|
|
DB_ENV *dbenv_c=dbc->dbp->dbenv;
|
|
|
|
DbEnv *env = (DbEnv*)dbenv_c->api1_internal;
|
2007-12-21 15:32:21 +00:00
|
|
|
return env->maybe_throw_error(ret);
|
2007-12-18 19:37:59 +00:00
|
|
|
}
|
2007-12-23 01:09:09 +00:00
|
|
|
|
2007-12-30 14:47:13 +00:00
|
|
|
int Dbc::pget(Dbt* key, Dbt *pkey, Dbt *data, u_int32_t flags) {
|
|
|
|
DBC *dbc = this;
|
|
|
|
int ret = dbc->c_pget(dbc, key, pkey, data, flags);
|
|
|
|
DB_ENV *dbenv_c=dbc->dbp->dbenv;
|
|
|
|
DbEnv *env = (DbEnv*)dbenv_c->api1_internal;
|
|
|
|
return env->maybe_throw_error(ret);
|
|
|
|
}
|
|
|
|
|
2007-12-27 21:37:04 +00:00
|
|
|
int Dbc::del(u_int32_t flags) {
|
|
|
|
DBC *dbc = this;
|
|
|
|
int ret = dbc->c_del(dbc, flags);
|
|
|
|
DB_ENV *dbenv_c=dbc->dbp->dbenv;
|
|
|
|
DbEnv *env = (DbEnv*)dbenv_c->api1_internal;
|
|
|
|
return env->maybe_throw_error(ret);
|
|
|
|
}
|
|
|
|
|
2007-12-23 01:09:09 +00:00
|
|
|
// Not callable, but some compilers require it to be defined anyway.
|
|
|
|
Dbc::~Dbc()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|