当前位置: 首页>>代码示例>>C++>>正文


C++ BRoster::GetRunningAppInfo方法代码示例

本文整理汇总了C++中BRoster::GetRunningAppInfo方法的典型用法代码示例。如果您正苦于以下问题:C++ BRoster::GetRunningAppInfo方法的具体用法?C++ BRoster::GetRunningAppInfo怎么用?C++ BRoster::GetRunningAppInfo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BRoster的用法示例。


在下文中一共展示了BRoster::GetRunningAppInfo方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: entry

char *__PHYSFS_platformCalcBaseDir(const char *argv0)
{
    /* in case there isn't a BApplication yet, we'll construct a roster. */
    BRoster roster;
    app_info info;
    status_t rc = roster.GetRunningAppInfo(getTeamID(), &info);
    BAIL_IF_MACRO(rc < B_OK, strerror(rc), NULL);
    BEntry entry(&(info.ref), true);
    BPath path;
    rc = entry.GetPath(&path);  /* (path) now has binary's path. */
    assert(rc == B_OK);
    rc = path.GetParent(&path); /* chop filename, keep directory. */
    assert(rc == B_OK);
    const char *str = path.Path();
    assert(str != NULL);
    char *retval = (char *) allocator.Malloc(strlen(str) + 1);
    BAIL_IF_MACRO(retval == NULL, ERR_OUT_OF_MEMORY, NULL);
    strcpy(retval, str);
    return(retval);
} /* __PHYSFS_platformCalcBaseDir */
开发者ID:BackupTheBerlios,项目名称:netpanzer-svn,代码行数:20,代码来源:beos.cpp

示例2: GetLocalSignature

//------------------------------------------------------------------------------
std::string TInstantiateObjectTester::GetLocalSignature()
{
	BRoster Roster;
	app_info ai;
	team_id team;

	// Get the team_id of this app
	thread_id tid = find_thread(NULL);
	thread_info ti;
	status_t err = get_thread_info(tid, &ti);
	if (err)
	{
		FORMAT_AND_THROW(" failed to get thread_info: ", err);
	}

	// Get the app_info via the team_id
	team = ti.team;
	team_info info;
	err = get_team_info(team, &info);
	if (err)
	{
		FORMAT_AND_THROW(" failed to get team_info: ", err);
	}

	team = info.team;

	// It seems that this call to GetRunningAppInfo() is not working because we
	// don't have an instance of BApplication somewhere -- the roster, therefore,
	// doesn't know about us.
	err = Roster.GetRunningAppInfo(team, &ai);
	if (err)
	{
		FORMAT_AND_THROW(" failed to get app_info: ", err);
	}

	// Return the signature from the app_info
	return ai.signature;
}
开发者ID:SummerSnail2014,项目名称:haiku,代码行数:39,代码来源:InstantiateObjectTester.cpp


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