本文整理汇总了C++中usercore::item::ItemInfoI::getExeList方法的典型用法代码示例。如果您正苦于以下问题:C++ ItemInfoI::getExeList方法的具体用法?C++ ItemInfoI::getExeList怎么用?C++ ItemInfoI::getExeList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类usercore::item::ItemInfoI
的用法示例。
在下文中一共展示了ItemInfoI::getExeList方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setInfo
void ExeSelectForm::setInfo(DesuraId id)
{
m_Id = id;
UserCore::Item::ItemInfoI *item = m_pItemManager->findItemInfo(id);
if (!item)
{
Close();
return;
}
if (item->getIcon() && UTIL::FS::isValidFile(UTIL::FS::PathWithFile(item->getIcon())))
{
setIcon(item->getIcon());
}
gcWString title(Managers::GetString(L"#ES_TITLE"), item->getName());
SetTitle(title);
gcWString text(Managers::GetString(L"#ES_LABEL"), item->getName());
m_labInfo->SetLabel(text);
m_labInfo->Wrap(350);
std::vector<UserCore::Item::Misc::ExeInfoI*> vExeList;
item->getExeList(vExeList);
gcButton* def = nullptr;
for (auto exe : vExeList)
{
gcWString name(exe->getName());
gcButton* but = new gcButton(this, wxID_ANY, name, wxDefaultPosition, wxSize(150, -1));
m_vButtonList.push_back(but);
m_pButtonSizer->Add( but, 0, wxALL, 2 );
if (name.find(L"Play") != std::wstring::npos)
def = but;
}
this->Layout();
if (def)
def->SetDefault();
}
示例2: onButtonClick
void ExeSelectForm::onButtonClick(wxCommandEvent& event)
{
for (size_t x=0; x<m_vButtonList.size(); x++)
{
if (m_vButtonList[x]->GetId() == event.GetId())
{
UserCore::Item::ItemInfoI *item = m_pItemManager->findItemInfo(m_Id);
std::vector<UserCore::Item::Misc::ExeInfoI*> vExeList;
item->getExeList(vExeList);
g_pMainApp->handleInternalLink(m_Id, ACTION_LAUNCH, FormatArgs(std::string("exe=") + vExeList[x]->getName(), m_bHasSeenCDKey?"cdkey":""));
break;
}
}
Close();
}
示例3: installLaunchScripts
void ItemHandle::installLaunchScripts()
{
UserCore::Item::ItemInfoI* item = getItemInfo();
if (!item)
return;
UserCore::Item::BranchInfoI* branch = item->getCurrentBranch();
if (!branch)
return;
std::vector<UserCore::Item::Misc::ExeInfoI*> exeList;
item->getExeList(exeList);
char* scriptBin = NULL;
char* scriptXdg = NULL;
try
{
UTIL::FS::readWholeFile(UTIL::STRING::toStr(
UTIL::OS::getDataPath(L"scripts/launch_bin_template.sh")), &scriptBin);
UTIL::FS::readWholeFile(UTIL::STRING::toStr(
UTIL::OS::getDataPath(L"scripts/launch_xdg_template.sh")), &scriptXdg);
}
catch (gcException &e)
{
safe_delete(scriptBin);
safe_delete(scriptXdg);
Warning(gcString("Failed to read launch script template: {0}\n", e));
return;
}
gcString globalArgs = getUserCore()->getCVarValue("gc_linux_launch_globalargs");
gcString globalExe = getUserCore()->getCVarValue("gc_linux_launch_globalbin");
if (!UTIL::FS::isValidFile(globalExe.c_str()))
globalExe = "";
for (size_t x=0; x<exeList.size(); x++)
{
UserCore::Item::Misc::ExeInfoI* exe = exeList[x];
if (!exe || !UTIL::FS::isValidFile(exe->getExe()))
continue;
gcString path("{0}/desura_launch_{1}.sh", item->getPath(), UTIL::LIN::sanitiseFileName(exe->getName()));
char magicBytes[5] = {0};
try
{
UTIL::FS::FileHandle fh(exe->getExe(), UTIL::FS::FILE_READ);
fh.read(magicBytes, 5);
}
catch (gcException& e)
{
continue;
}
UTIL::LIN::BinType type = UTIL::LIN::getFileType(magicBytes, 5);
try
{
UTIL::FS::FileHandle fh(path.c_str(), UTIL::FS::FILE_WRITE);
if (type == UTIL::LIN::BT_UNKNOWN)
{
gcString lcmd(scriptXdg, exe->getExe());
fh.write(lcmd.c_str(), lcmd.size());
}
else
{
gcString libPath("\"{0}/{1}/{2}/lib\"", UTIL::OS::getAppDataPath(), branch->getItemId().getFolderPathExtension(), (uint32)branch->getBranchId());
gcString libPathB("{0}/lib{1}", item->getPath(), branch->is32Bit()?"32":"64");
if (UTIL::FS::isValidFolder(libPathB.c_str()))
{
libPath += ":";
libPath += "\"" + libPathB + "\"";
}
const char* exePath = exe->getExe();
gcString args;
gcString ea(exe->getExeArgs());
if (globalExe.size() > 0)
{
args += gcString(exePath);
exePath = globalExe.c_str();
}
if (ea.size() > 0)
{
if (args.size() > 0)
args += " ";
args += ea;
//.........这里部分代码省略.........