Esempio n. 1
0
void wb_dbms_rbody::iter(wb_import &i)
{
    int rc = 0;

    memset(&m_oid, 0, sizeof(m_oid));

    m_data.data(m_db->m_buf);
    m_data.size(sizeof(m_db->m_buf));
    m_data.bSize(sizeof(m_db->m_buf));

    m_db->m_t_rbody->cursor(m_db->m_txn, &m_key, &m_data, &m_dbc);

    while (1) {
        try {
            rc = m_dbc->get();
        }
        catch (wb_dbms_error &e) {
            printf("Exc: %s\n", e.what().c_str());
        }

        if (rc != 0)
            break;

        i.importRbody(m_oid, m_data.size(), m_data.data());
    }

    m_dbc->close();
    delete m_dbc;
    m_dbc = 0;
}
Esempio n. 2
0
void wb_dbms_dbody::iter(wb_import &i)
{
    int rc = 0;

    memset(&m_oid, 0, sizeof(m_oid));

    m_data.data(m_db->m_buf);
    m_data.size(sizeof(m_db->m_buf));
    m_data.bSize(sizeof(m_db->m_buf));

    m_db->m_t_dbody->cursor(m_db->m_txn, &m_key, &m_data, &m_dbc);

    /* Walk through the database and print out the key/data pairs. */

    while (1) {

        try {
            rc = m_dbc->get();
        }
        catch (wb_dbms_error &e) {
            printf("Exc: %s\n", e.what().c_str());
        }

        if (rc != 0)
            break;

        i.importDbody(m_oid, m_data.size(), m_data.data());
    }

    m_dbc->close();
    delete m_dbc;
    m_dbc = 0;
}
Esempio n. 3
0
void wb_db_dbody::iter(wb_import &i)
{
  int rc = 0;

  m_db->m_t_dbody->cursor(m_db->m_txn, &m_dbc, 0);

  /* Initialize the key/data pair so the flags aren't set. */
  memset(&m_oid, 0, sizeof(m_oid));
  m_key.set_data(&m_oid);
  m_key.set_ulen(sizeof(m_oid));
  m_key.set_flags(DB_DBT_USERMEM);
  m_data.set_flags(DB_DBT_MALLOC);


  /* Walk through the database and print out the key/data pairs. */

  while (1) {

    try {
      rc = m_dbc->get(&m_key, &m_data, DB_NEXT);
    }
    catch (DbException &e) {
      printf("Exc: %s\n", e.what());
    }

    if (rc == DB_NOTFOUND)
      break;

    i.importDbody(m_oid, m_data.get_size(), m_data.get_data());
    free(m_data.get_data());
 }

  m_dbc->close();
}
Esempio n. 4
0
bool wb_vrepdbs::exportDbody(wb_import& i)
{
  dbs_sBody* bp = 0;
  pwr_tStatus sts;

  while ((bp = dbs_NextDbody(&sts, dbsenv(), bp))) {
    i.importDbody(bp->oid, bp->size, (void*)(bp + 1));
  }

  return true;
}
Esempio n. 5
0
bool wb_vrepdbs::exportHead(wb_import& i)
{
  dbs_sObject* op = 0;
  pwr_tStatus sts;

  while ((op = dbs_NextHead(&sts, dbsenv(), op))) {
    i.importHead(op->oid, op->cid, op->poid, op->boid, op->aoid, op->foid,
        op->loid, op->name, op->normname, op->ohFlags, op->time, op->rbody.time,
        op->dbody.time, op->rbody.size, op->dbody.size);
  }

  return true;
}
Esempio n. 6
0
void wb_dbms_ohead::iter(wb_import &i)
{
    int rc = 0;

    rc = m_db->m_t_ohead->cursor(m_db->m_txn, &m_key, &m_data, &m_dbc);

    memset(&m_oid, 0, sizeof(m_oid));
    memset(&m_o, 0, sizeof(m_o));

    while ((rc = m_dbc->get()) == 0) {
        i.importHead(m_o.oid, m_o.cid, m_o.poid, m_o.boid, m_o.aoid, m_o.foid, m_o.loid, m_o.name, m_o.normname,
                     m_o.flags, m_o.time, m_o.body[0].time, m_o.body[1].time, m_o.body[0].size, m_o.body[1].size);
    }

    m_dbc->close();
    delete m_dbc;
    m_dbc = 0;
}
Esempio n. 7
0
void wb_db_ohead::iter(wb_import &i)
{
  int rc = 0;

  rc = m_db->m_t_ohead->cursor(m_db->m_txn, &m_dbc, 0);

  memset(&m_oid, 0, sizeof(m_oid));
  memset(&m_o, 0, sizeof(m_o));

  m_key.set_data(&m_oid);
  m_key.set_ulen(sizeof(m_oid));
  m_key.set_flags(DB_DBT_USERMEM);

  m_data.set_data(&m_o);
  m_data.set_ulen(sizeof(m_o));
  m_data.set_flags(DB_DBT_USERMEM);

  while ((rc = m_dbc->get(&m_key, &m_data, DB_NEXT)) == 0) {
    i.importHead(m_o.oid, m_o.cid, m_o.poid, m_o.boid, m_o.aoid, m_o.foid, m_o.loid, m_o.name, m_o.normname,
                 m_o.flags, m_o.time, m_o.body[0].time, m_o.body[1].time, m_o.body[0].size, m_o.body[1].size);
  }

  m_dbc->close();
}
Esempio n. 8
0
bool wb_vrepdbs::exportMeta(wb_import& i)
{
  i.importMeta(dbsenv()->mp);

  return false;
}
Esempio n. 9
0
bool wb_vrepdbs::exportVolume(wb_import& i)
{
  return i.importVolume(*this);
}