本文整理汇总了C++中Db::get_DB方法的典型用法代码示例。如果您正苦于以下问题:C++ Db::get_DB方法的具体用法?C++ Db::get_DB怎么用?C++ Db::get_DB使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Db
的用法示例。
在下文中一共展示了Db::get_DB方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: BulkHeaderGroupBody
bool BulkHeaderGroup::BulkHeaderGroupBody()
{
// belt and braces
key.set_data(keymem);
data.set_data(datamem);
if (m_cancel)
{
emit updateJob(JobList::BulkHeaderGroup, JobList::Cancelled, job->seq);
return false;
}
emit updateJob(JobList::BulkHeaderGroup, JobList::Running, job->seq);
NewsGroup* ng = job->ng;
Db* db = ng->getDb();
MultiPartHeader mph;
SinglePartHeader sph;
HeaderBase* hb = 0;
HeaderGroup* headerGroup = 0;
HeaderGroup* advancedHeaderGroup = 0;
// typedef QMap<QString, QString> HeaderGroupIndexes; // subj, headerGroup index
// typedef QMap<QString, HeaderGroup*> HeaderGroups; // headerGroup index, headerGroup *
HeaderGroupIndexes headerGroupIndexes;
HeaderGroups headerGroups;
DBC *dbcp = 0;
DBT ckey, cdata;
memset(&ckey, 0, sizeof(ckey));
memset(&cdata, 0, sizeof(cdata));
size_t retklen, retdlen;
void *retkey = 0, *retdata = 0;
int ret, t_ret;
void *p = 0;
quint64 count=0;
cdata.data = (void *) new char[HEADER_BULK_BUFFER_LENGTH];
cdata.ulen = HEADER_BULK_BUFFER_LENGTH;
cdata.flags = DB_DBT_USERMEM;
ckey.data = (void *) new char[HEADER_BULK_BUFFER_LENGTH];
ckey.ulen = HEADER_BULK_BUFFER_LENGTH;
ckey.flags = DB_DBT_USERMEM;
/* Acquire a cursor for the database. */
if ((ret = db->get_DB()->cursor(db->get_DB(), NULL, &dbcp, DB_CURSOR_BULK)) != 0)
{
db->err(ret, "DB->cursor");
char* ptr = 0;
ptr = (char*)(ckey.data);
Q_DELETE_ARRAY(ptr);
ptr = (char*)(cdata.data);
Q_DELETE_ARRAY(ptr);
return false;
}
// To save the group records
ng->articlesNeedDeleting(false);
// Store the data in the database - flush first ...
u_int32_t delCount;
uchar keymem[KEYMEM_SIZE];
uchar datamem[DATAMEM_SIZE];
Dbt key, data;
char* p2 = 0;
QByteArray ba;
const char *k = 0;
key.set_flags(DB_DBT_USERMEM);
key.set_data(&keymem);
key.set_ulen(KEYMEM_SIZE);
data.set_flags(DB_DBT_USERMEM);
data.set_ulen(DATAMEM_SIZE);
data.set_data(&datamem);
QString subj = "MDQuban", from = "MDQuban";
//QString rs1 = "^(.*)(\".*\")";
//QString rs2 = "^(.*)\\s-\\s(.*)$";
//QString rs3 = "^(\\S+.*)\\[.*\\].*(\".*\")";
//QString rs3 = "^(.*)\\s-\\s.*\\s-\\s(.*)$";
QRegExp rx[3];
bool rxPosBack[3];
bool noRegexpGrouping;
QString recKey, storeIndex;
QString prevSubj = "MDQuban", prevFrom = "MDQuban";
int pos;
//.........这里部分代码省略.........