本文整理汇总了C++中BResources::InitCheck方法的典型用法代码示例。如果您正苦于以下问题:C++ BResources::InitCheck方法的具体用法?C++ BResources::InitCheck怎么用?C++ BResources::InitCheck使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BResources
的用法示例。
在下文中一共展示了BResources::InitCheck方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: file
/*static*/ void
BApplication::_InitAppResources()
{
entry_ref ref;
bool found = false;
// App is already running. Get its entry ref with
// GetAppInfo()
app_info appInfo;
if (be_app && be_app->GetAppInfo(&appInfo) == B_OK) {
ref = appInfo.ref;
found = true;
} else {
// Run() hasn't been called yet
found = BPrivate::get_app_ref(&ref) == B_OK;
}
if (!found)
return;
BFile file(&ref, B_READ_ONLY);
if (file.InitCheck() != B_OK)
return;
BResources* resources = new (std::nothrow) BResources(&file, false);
if (resources == NULL || resources->InitCheck() != B_OK) {
delete resources;
return;
}
sAppResources = resources;
}
示例2: file
BResources*
CayaResources()
{
image_info info;
if (our_image(info) != B_OK)
return NULL;
BFile file(info.name, B_READ_ONLY);
if (file.InitCheck() != B_OK)
return NULL;
BResources* res = new BResources(&file);
if (res->InitCheck() != B_OK) {
delete res;
return NULL;
}
return res;
}