本文整理汇总了C++中GetDB函数的典型用法代码示例。如果您正苦于以下问题:C++ GetDB函数的具体用法?C++ GetDB怎么用?C++ GetDB使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetDB函数的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CachePut
// Create CDDB file
bool Dbase::Write(const Cddb::Album& album)
{
CachePut(album);
const QString genre = !album.discGenre.isEmpty() ?
album.discGenre.toLower().toUtf8() : "misc";
LOG(VB_MEDIA, LOG_INFO, "WriteDB " + genre +
QString(" %1 ").arg(album.discID,0,16) +
album.artist + " / " + album.title);
if (QDir(GetDB()).mkpath(genre))
{
QFile file(GetDB() + '/' + genre + '/' +
QString::number(album.discID,16));
if (file.open(QIODevice::WriteOnly | QIODevice::Text))
{
QTextStream(&file) << album;
return true;
}
else
LOG(VB_GENERAL, LOG_ERR, "Cddb can't write " + file.fileName());
}
else
LOG(VB_GENERAL, LOG_ERR, "Cddb can't mkpath " + GetDB() + '/' + genre);
return false;
}
示例2: GetDB
Boolean Pfml2::InnerGetAlmStatus(TBlkAttr *pAboObj,UINT nID)
{
CPFMDatabase *pDB = GetDB();
if (NULL !=pDB)
return pDB->GetAlmStatus(pAboObj,nID);
return SDB_RET_FAILED ;
};
示例3: GetDB
BOOL KGatewayDataProcess::CheckConnectAddress()
{
S3PDBConVBC* pConn = GetDB(0);
if (pConn)
return S3PAccount::CheckAddress(pConn, m_Address, m_Port) == ACTION_SUCCESS;
return FALSE;
}
示例4: bdb_sary_slice_bang
static VALUE
bdb_sary_slice_bang(int argc, VALUE *argv, VALUE obj)
{
VALUE arg1, arg2;
long pos, len;
bdb_DB *dbst;
GetDB(obj, dbst);
if (rb_scan_args(argc, argv, "11", &arg1, &arg2) == 2) {
pos = NUM2LONG(arg1);
len = NUM2LONG(arg2);
delete_pos_len:
if (pos < 0) {
pos = dbst->len + pos;
}
arg2 = bdb_sary_subseq(obj, pos, len);
bdb_sary_replace(obj, pos, len, Qnil);
return arg2;
}
if (!FIXNUM_P(arg1) && rb_range_beg_len(arg1, &pos, &len, dbst->len, 1)) {
goto delete_pos_len;
}
pos = NUM2LONG(arg1);
if (pos >= dbst->len) return Qnil;
if (pos < 0) pos += dbst->len;
if (pos < 0) return Qnil;
arg1 = INT2NUM(pos);
arg2 = bdb_sary_at(obj, arg1);
if (bdb_del(obj, arg1) != Qnil) dbst->len--;
return arg2;
}
示例5: bdb_sary_aref
/*
* call-seq:
* db[nth]
* db[start..end]
* db[start, length]
*
* Element reference - with the following syntax:
*
* * db[nth]
*
* Retrieves the +nth+ item from an array. Index starts from
* zero. If index is the negative, counts backward from the end
* of the array. The index of the last element is -1. Returns
* +nil+, if the +nth+ element does not exist in the array.
*
* * db[start..end]
*
* Returns an array containing the objects from +start+ to +end+,
* including both ends. if end is larger than the length of the
* array, it will be rounded to the length. If +start+ is out of
* an array range , returns +nil+. And if +start+ is larger than
* end with in array range, returns empty array ([]).
*
* * db[start, length]
*
* Returns an array containing +length+ items from +start+.
* Returns +nil+ if +length+ is negative.
*/
static VALUE
bdb_sary_aref(int argc, VALUE *argv, VALUE obj)
{
VALUE arg1, arg2;
long beg, len;
bdb_DB *dbst;
GetDB(obj, dbst);
if (rb_scan_args(argc, argv, "11", &arg1, &arg2) == 2) {
beg = NUM2LONG(arg1);
len = NUM2LONG(arg2);
if (beg < 0) {
beg = dbst->len + beg;
}
return bdb_sary_subseq(obj, beg, len);
}
if (FIXNUM_P(arg1)) {
return bdb_sary_entry(obj, arg1);
}
else if (TYPE(arg1) == T_BIGNUM) {
rb_raise(rb_eIndexError, "index too big");
}
else {
switch (rb_range_beg_len(arg1, &beg, &len, dbst->len, 0)) {
case Qfalse:
break;
case Qnil:
return Qnil;
default:
return bdb_sary_subseq(obj, beg, len);
}
}
return bdb_sary_entry(obj, arg1);
}
示例6: bdb_sary_delete
static VALUE
bdb_sary_delete(VALUE obj, VALUE item)
{
bdb_DB *dbst;
long i1, i2;
VALUE tmp, a;
GetDB(obj, dbst);
i2 = dbst->len;
for (i1 = 0; i1 < dbst->len;) {
tmp = INT2NUM(i1);
a = bdb_get(1, &tmp, obj);
if (rb_equal(a, item)) {
bdb_del(obj, INT2NUM(i1));
dbst->len--;
}
else {
i1++;
}
}
if (dbst->len == i2) {
if (rb_block_given_p()) {
return rb_yield(item);
}
return Qnil;
}
return item;
}
示例7: bdb_sary_reverse_bang
static VALUE
bdb_sary_reverse_bang(VALUE obj)
{
long i, j;
bdb_DB *dbst;
VALUE tmp[2], interm;
GetDB(obj, dbst);
if (dbst->len <= 1) return obj;
i = 0;
j = dbst->len - 1;
while (i < j) {
tmp[0] = INT2NUM(i);
interm = bdb_get(1, tmp, obj);
tmp[0] = INT2NUM(j);
tmp[1] = bdb_get(1, tmp, obj);
tmp[0] = INT2NUM(i);
bdb_put(2, tmp, obj);
tmp[0] = INT2NUM(j);
tmp[1] = interm;
bdb_put(2, tmp, obj);
i++; j--;
}
return obj;
}
示例8: bdb_sary_unshift_m
static VALUE
bdb_sary_unshift_m(int argc, VALUE *argv, VALUE obj)
{
bdb_DB *dbst;
VALUE tmp[2];
long i;
if (argc == 0) {
rb_raise(rb_eArgError, "wrong # of arguments(at least 1)");
}
if (argc > 0) {
/* ++ */
GetDB(obj, dbst);
for (i = dbst->len - 1; i >= 0; i++) {
tmp[0] = INT2NUM(i);
tmp[1] = bdb_get(1, tmp, obj);
tmp[0] = INT2NUM(i + argc);
bdb_put(2, tmp, obj);
}
for (i = 0; i < argc; i++) {
tmp[0] = INT2NUM(i);
tmp[1] = argv[i];
bdb_put(2, tmp, obj);
dbst->len++;
}
}
return obj;
}
示例9: SetStartTime
void ContrastDialog::OnGetForegroundDB( wxCommandEvent &event )
{
SetStartTime(mForegroundStartT->GetTimeValue());
SetEndTime(mForegroundEndT->GetTimeValue());
foregrounddB = GetDB();
m_pButton_UseCurrentF->SetFocus();
results();
}
示例10: GetDB
Configure::~Configure()
{
Database::Typed<Entry> &db = GetDB();
if (mPrev)
db.Put(mTagId, mPrev);
else
db.Delete(mTagId);
}
示例11: locker
int Pfml2::AlmGetAll(list<SAlmDataItem> &listAlm)
{
CModAutoLocker locker(this);
CPFMDatabase *pDB = GetDB();
if (NULL !=pDB)
return pDB->AlmGetAll(listAlm);
return SDB_RET_FAILED ;
}
示例12: LOCK
bool BaseIndex::WriteBestBlock(const CBlockIndex* block_index)
{
LOCK(cs_main);
if (!GetDB().WriteBestBlock(chainActive.GetLocator(block_index))) {
return error("%s: Failed to write locator to disk", __func__);
}
return true;
}
示例13: WXUNUSED
void ContrastDialog::OnGetBackgroundDB( wxCommandEvent & WXUNUSED(event))
{
SetStartTime(mBackgroundStartT->GetTimeValue());
SetEndTime(mBackgroundEndT->GetTimeValue());
backgrounddB = GetDB();
m_pButton_UseCurrentB->SetFocus();
results();
}