Пример #1
0
void wb_db_rbody::iter(wb_import &i)
{
  int rc = 0;


  m_db->m_t_rbody->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);

  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.importRbody(m_oid, m_data.get_size(), m_data.get_data());
    free(m_data.get_data());
  }

  m_dbc->close();
}
Пример #2
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;
}
Пример #3
0
bool wb_vrepdbs::exportRbody(wb_import& i)
{
  dbs_sBody* bp = 0;
  pwr_tStatus sts;

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

  return true;
}