本文整理汇总了C++中gcString类的典型用法代码示例。如果您正苦于以下问题:C++ gcString类的具体用法?C++ gcString怎么用?C++ gcString使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了gcString类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: GetWildcardPath
gcString GetWildcardPath(gcString wildcard)
{
#ifdef WIN32
if (Safe::stricmp("PROGRAM_FILES", wildcard.c_str()) == 0)
{
wchar_t path[MAX_PATH] = {0};
SHGetFolderPathW(NULL, CSIDL_PROGRAM_FILES, NULL, SHGFP_TYPE_CURRENT, path);
return path;
}
else if (Safe::stricmp("DOCUMENTS", wildcard.c_str()) == 0)
{
return GetSpecialPath(1);
}
else if (Safe::stricmp("JAVA_PATH", wildcard.c_str()) == 0)
{
std::string cur = UTIL::WIN::getRegValue("HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Runtime Environment\\CurrentVersion");
if (cur.size() > 0)
return UTIL::WIN::getRegValue(gcString("HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Runtime Environment\\{0}\\JavaHome", cur));
}
else if (Safe::stricmp("APP_DATA", wildcard.c_str())==0)
{
wchar_t path[MAX_PATH] = {0};
SHGetFolderPathW(NULL, CSIDL_COMMON_APPDATA, NULL, SHGFP_TYPE_CURRENT, path);
return path;
}
else if (Safe::stricmp("USER_APP_DATA", wildcard.c_str())==0)
{
return GetSpecialPath(2);
}
#endif
return "";
}
开发者ID:boskee,项目名称:Desurium-1,代码行数:33,代码来源:InstallScriptRunTime.cpp
示例2: GetCVarManager
void DesuraJSSettings::setValue(gcString name, gcString val)
{
CVar* cvar = GetCVarManager()->findCVar(name.c_str());
if (cvar && val != gcString(cvar->getString()))
cvar->setValue(val.c_str());
}
开发者ID:BlastarIndia,项目名称:Desurium,代码行数:7,代码来源:gcJSSettings.cpp
示例3: getRelativePath
gcString getRelativePath(const gcString &path)
{
gcString wd = UTIL::LIN::getAppPath(L"");
if (path.find(wd) == 0)
return path.substr(wd.size()+1, std::string::npos);
return path;
}
开发者ID:EasyCoding,项目名称:desura-app,代码行数:9,代码来源:UtilLinux.cpp
示例4: GetGCThemeManager
gcString DesuraJSBinding::getThemeColor(gcString name, gcString id)
{
Color col = GetGCThemeManager()->getColor(name.c_str(), id.c_str());
char colStr[255];
Safe::snprintf(colStr, 255, (char*)"#%02X%02X%02X", col.red, col.green, col.blue);
return gcString(colStr);
}
开发者ID:EasyCoding,项目名称:desura-app,代码行数:9,代码来源:gcJSBinding.cpp
示例5: parseTimeStamp
static gcTime parseTimeStamp(gcString &str)
{
//Boost throws exception if no time string. :(
if (str.find('T') == std::string::npos)
{
str = str.substr(0, 8) + "T" + str.substr(8);
}
return gcTime::from_iso_string(str);
}
开发者ID:callumlinden,项目名称:desura-app,代码行数:10,代码来源:SFTWorker.cpp
示例6: AddTool
void AddTool(UserItem* item, gcString name, gcString exe, gcString args, gcString res)
{
if (!item)
return;
if (name.size() == 0 || exe.size() == 0)
return;
item->m_pToolManager->addJSTool(item->m_pItem, item->m_pBranch->getBranchId(), name, exe, args, res);
}
开发者ID:BlastarIndia,项目名称:Desurium,代码行数:10,代码来源:ToolManager_Script.cpp
示例7: AddTool
void AddTool(UserItem* item, gcString name, gcString exe, gcString args, gcString res)
{
if (!item)
return;
if (name.size() == 0 || exe.size() == 0)
return;
Debug(gcString("Adding JS Tool to {0}: {1} {2} {3}\n", item->m_pItem->getName(), name, exe, args));
item->m_pToolManager->addJSTool(item->m_pItem, item->m_pBranch->getBranchId(), name, exe, args, res);
}
开发者ID:lodle,项目名称:desura-app,代码行数:11,代码来源:ToolManager_Script.cpp
示例8: getAbsPath
gcString getAbsPath(const gcString& path)
{
if (path.size() == 0 || path[0] == '/')
return path;
gcString wd = UTIL::LIN::getAppPath(L"");
if (path.find(wd) == std::string::npos)
return wd + "/" + path;
return path;
}
开发者ID:EasyCoding,项目名称:desura-app,代码行数:12,代码来源:UtilLinux.cpp
示例9: loadUrl
void DesuraJSLinks::loadUrl(int32 tabId, gcString url)
{
if (tabId == -1)
return;
if (tabId >= END_PAGE || tabId != ITEMS)
return;
if (url.size() == 0)
return;
g_pMainApp->loadUrl(url.c_str(), (PAGE)tabId);
}
开发者ID:Alasaad,项目名称:Desurium,代码行数:13,代码来源:gcJSLinks.cpp
示例10: onComplete
void CDKProgress::onComplete(gcString& cdKey)
{
CDKeyForm* keyForm = dynamic_cast<CDKeyForm*>(GetParent());
if (keyForm)
keyForm->finish(cdKey.c_str());
}
开发者ID:EasyCoding,项目名称:desura-app,代码行数:7,代码来源:CDKProgress.cpp
示例11: loadUrl
void gcWebControl::loadUrl(const gcString& url)
{
if (m_szHomeUrl == L"about:blank")
m_szHomeUrl = url;
m_pChromeBrowser->loadUrl(url.c_str());
}
开发者ID:lodle,项目名称:desura-app,代码行数:7,代码来源:gcWebControl.cpp
示例12: checkMcf
bool VSCheckMcf::checkMcf(gcString path)
{
if (isStopped())
return false;
if (!UTIL::FS::isValidFile(UTIL::FS::PathWithFile(path)))
return false;
//read file to make sure it is what it says it is
m_hTempMcf->setFile(path.c_str());
try
{
m_hTempMcf->parseMCF();
}
catch (gcException &except)
{
Warning("Verify - MCF Error: {0}\n", except);
return false;
}
if (isStopped())
return false;
MCFCore::MCFHeaderI *mcfHead = m_hTempMcf->getHeader();
bool res = (mcfHead && mcfHead->getBuild() == getMcfBuild());
m_hTempMcf = McfHandle();
return res;
}
开发者ID:EasyCoding,项目名称:desura-app,代码行数:31,代码来源:VSCheckMcf.cpp
示例13: key
void BranchInfo::decodeCDKey(gcString cdkey)
{
m_szCDKey = "";
if (cdkey.size() == 0)
return;
#ifdef WIN32
size_t outLen = 0;
char* raw = (char*)UTIL::STRING::base64_decode(cdkey, outLen);
std::string reg = UTIL::OS::getConfigValue("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography\\MachineGuid", true);
gcString key("{0}_{1}", reg, m_ItemId.toInt64());
DATA_BLOB db;
db.pbData = (BYTE*)raw;
db.cbData = outLen;
DATA_BLOB secret;
secret.pbData = (BYTE*)key.c_str();
secret.cbData = key.size();
DATA_BLOB out;
if (CryptUnprotectData(&db, NULL, &secret, NULL, NULL, CRYPTPROTECT_UI_FORBIDDEN, &out))
m_szCDKey.assign((char*)out.pbData, out.cbData);
safe_delete(raw);
#else // TODO
m_szCDKey = cdkey;
#endif
}
开发者ID:Alasaad,项目名称:Desurium,代码行数:33,代码来源:BranchInfo.cpp
示例14: getValue
gcString DesuraJSSettings::getValue(gcString name)
{
CVar* cvar = GetCVarManager()->findCVar(name.c_str());
if (!cvar)
return "";
return cvar->getExitString();
}
开发者ID:BlastarIndia,项目名称:Desurium,代码行数:8,代码来源:gcJSSettings.cpp
示例15: getCVarValue
gcString DesuraJSBinding::getCVarValue(gcString name)
{
auto cvar = GetCVarManager()->findCVar(name.c_str());
if (!cvar)
return "";
return cvar->getString();
}
开发者ID:EasyCoding,项目名称:desura-app,代码行数:9,代码来源:gcJSBinding.cpp
示例16: onComplete
void DownloadTask::onComplete(gcString &savePath)
{
bool hasError = m_bInError || isStopped();
if (m_bToolDownloadComplete)
{
getUserCore()->getToolManager()->removeTransaction(m_ToolTTID, hasError);
m_ToolTTID = UINT_MAX;
}
if (hasError)
{
getItemHandle()->getInternal()->completeStage(true);
return;
}
onCompleteStrEvent(savePath);
if (getItemInfo()->getCurrentBranch()->isPreOrder())
{
getItemInfo()->addSFlag(UserCore::Item::ItemInfoI::STATUS_PRELOADED);
getItemInfo()->delSFlag(UserCore::Item::ItemInfoI::STATUS_DOWNLOADING);
getItemHandle()->getInternal()->completeStage(true);
}
else if (m_ToolTTID != UINT_MAX)
{
UserCore::Misc::ToolTransaction* tt = new UserCore::Misc::ToolTransaction();
getUserCore()->getToolManager()->updateTransaction(m_ToolTTID, tt);
getItemHandle()->getInternal()->goToStageDownloadTools(m_ToolTTID, savePath.c_str(), getMcfBranch(), getMcfBuild());
}
else
{
//mirrored in download tool item task. Make sure to update it as well
if (HasAllFlags(getItemInfo()->getStatus(), UserCore::Item::ItemInfoI::STATUS_INSTALLCOMPLEX))
{
getItemHandle()->getInternal()->goToStageInstallComplex(getMcfBranch(), getMcfBuild());
}
else
{
getItemHandle()->getInternal()->goToStageInstall(savePath.c_str(), getMcfBranch());
}
}
}
开发者ID:lodle,项目名称:desura-app,代码行数:44,代码来源:DownloadTask.cpp
示例17: WriteFile
bool FileSystemJSBinding::WriteFile(int32 handle, gcString string)
{
if (handle < 0 || handle > (int32)m_vFileHandles.size())
return false;
auto fh = m_vFileHandles[handle];
try
{
fh->write(string.c_str(), string.size());
return true;
}
catch (gcException &e)
{
Warning("Failed to write to file in scriptcore: {0}\n", e);
}
return false;
}
开发者ID:EasyCoding,项目名称:desura-app,代码行数:19,代码来源:jsFS.cpp
示例18: id
gcRefPtr<UserCore::Item::ItemInfoI> DesuraJSBinding::getItemInfoFromId(gcString szId)
{
auto im = getItemManager();
if (!im)
return nullptr;
DesuraId id(Safe::atoll(szId.c_str()));
return im->findItemInfo(id);
}
开发者ID:EasyCoding,项目名称:desura-app,代码行数:10,代码来源:gcJSBinding.cpp
示例19: getListOfBadMcfPaths
void MCFManager::getListOfBadMcfPaths(const gcString &szItemDb, std::vector<MigrateInfo> &delList, std::vector<MigrateInfo> &updateList)
{
try
{
sqlite3x::sqlite3_connection db(szItemDb.c_str());
getListOfBadMcfPaths(db, delList, updateList);
}
catch (std::exception &)
{
}
}
开发者ID:EasyCoding,项目名称:desura-app,代码行数:11,代码来源:McfManager.cpp
示例20: extractInstallChecks
void BranchInstallInfo::extractInstallChecks(const XML::gcXMLElement &icsNode, gcRefPtr<WildcardManager> &pWildCard, std::vector<InsCheck> &vInsChecks)
{
icsNode.for_each_child("installlocation", [&vInsChecks, pWildCard, this](const XML::gcXMLElement &icNode)
{
const gcString iCheck = icNode.GetChild("check");
const gcString iPath = icNode.GetChild("path");
if (iCheck.empty() || iPath.empty())
return;
try
{
gcString strCheckRes = pWildCard->constructPath(iCheck.c_str());
if (isInstalled())
{
if (!updateInstallCheck(strCheckRes, iPath))
return;
vInsChecks.push_back(InsCheck(strCheckRes.c_str(), m_szPath.c_str()));
}
else
{
vInsChecks.push_back(InsCheck(strCheckRes.c_str(), iPath.c_str()));
}
}
catch (...)
{
}
});
}
开发者ID:aromis,项目名称:desura-app,代码行数:31,代码来源:BranchInstallInfo.cpp
注:本文中的gcString类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论