• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ GetDB函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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;
}
开发者ID:faginbagin,项目名称:mythtv,代码行数:28,代码来源:cddb.cpp


示例2: GetDB

Boolean  Pfml2::InnerGetAlmStatus(TBlkAttr *pAboObj,UINT nID)
{
	CPFMDatabase  *pDB = GetDB();
	if (NULL !=pDB)
		return pDB->GetAlmStatus(pAboObj,nID);
	return SDB_RET_FAILED ;
};
开发者ID:LiZoRN,项目名称:smartdb,代码行数:7,代码来源:Pfml2.cpp


示例3: GetDB

BOOL KGatewayDataProcess::CheckConnectAddress()
{
	S3PDBConVBC* pConn = GetDB(0);
	if (pConn)
		return S3PAccount::CheckAddress(pConn, m_Address, m_Port) == ACTION_SUCCESS;
	return FALSE;
}
开发者ID:XeanoRRR,项目名称:mmo-resourse,代码行数:7,代码来源:S3PDBSocketPool.cpp


示例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;
}
开发者ID:tevren,项目名称:ruby-bdb,代码行数:34,代码来源:recnum.c


示例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);
}
开发者ID:tevren,项目名称:ruby-bdb,代码行数:63,代码来源:recnum.c


示例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;
}
开发者ID:tevren,项目名称:ruby-bdb,代码行数:28,代码来源:recnum.c


示例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;
}
开发者ID:tevren,项目名称:ruby-bdb,代码行数:25,代码来源:recnum.c


示例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;
}
开发者ID:tevren,项目名称:ruby-bdb,代码行数:28,代码来源:recnum.c


示例9: SetStartTime

void ContrastDialog::OnGetForegroundDB( wxCommandEvent &event )
{
   SetStartTime(mForegroundStartT->GetTimeValue());
   SetEndTime(mForegroundEndT->GetTimeValue());
   foregrounddB = GetDB();
   m_pButton_UseCurrentF->SetFocus();
   results();
}
开发者ID:ruthmagnus,项目名称:audacity,代码行数:8,代码来源:Contrast.cpp


示例10: GetDB

		Configure::~Configure()
		{
			Database::Typed<Entry> &db = GetDB();
			if (mPrev)
				db.Put(mTagId, mPrev);
			else
				db.Delete(mTagId);
		}
开发者ID:Fissuras,项目名称:videoventure,代码行数:8,代码来源:Behavior.cpp


示例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 ;
}
开发者ID:LiZoRN,项目名称:smartdb,代码行数:8,代码来源:Pfml2.cpp


示例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;
}
开发者ID:GlobalBoost,项目名称:GlobalBoost,代码行数:8,代码来源:base.cpp


示例13: WXUNUSED

void ContrastDialog::OnGetBackgroundDB( wxCommandEvent & WXUNUSED(event))
{
   SetStartTime(mBackgroundStartT->GetTimeValue());
   SetEndTime(mBackgroundEndT->GetTimeValue());
   backgrounddB = GetDB();
   m_pButton_UseCurrentB->SetFocus();
   results();
}
开发者ID:JordanGraves,项目名称:TabMagic,代码行数:8,代码来源:Contrast.cpp



注:本文中的GetDB函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GetDC函数代码示例发布时间:2022-05-30
下一篇:
C++ GetCursorPos函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap