本文整理汇总了C++中gcString类的典型用法代码示例。如果您正苦于以下问题:C++ gcString类的具体用法?C++ gcString怎么用?C++ gcString使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了gcString类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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 "";
}
示例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());
}
示例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;
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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;
}
示例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);
}
示例10: onComplete
void CDKProgress::onComplete(gcString& cdKey)
{
CDKeyForm* keyForm = dynamic_cast<CDKeyForm*>(GetParent());
if (keyForm)
keyForm->finish(cdKey.c_str());
}
示例11: loadUrl
void gcWebControl::loadUrl(const gcString& url)
{
if (m_szHomeUrl == L"about:blank")
m_szHomeUrl = url;
m_pChromeBrowser->loadUrl(url.c_str());
}
示例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;
}
示例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
}
示例14: getValue
gcString DesuraJSSettings::getValue(gcString name)
{
CVar* cvar = GetCVarManager()->findCVar(name.c_str());
if (!cvar)
return "";
return cvar->getExitString();
}
示例15: getCVarValue
gcString DesuraJSBinding::getCVarValue(gcString name)
{
auto cvar = GetCVarManager()->findCVar(name.c_str());
if (!cvar)
return "";
return cvar->getString();
}