本文整理汇总了C++中wstring::back方法的典型用法代码示例。如果您正苦于以下问题:C++ wstring::back方法的具体用法?C++ wstring::back怎么用?C++ wstring::back使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wstring
的用法示例。
在下文中一共展示了wstring::back方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: rtrim
void Utils::rtrim(wstring& s, const wchar_t c)
{
while (!s.empty() && s.back() == c)
{
s.pop_back();
}
}
示例2: EscapeCommandLineArg
wstring Helpers::EscapeCommandLineArg(const wstring& str)
{
wstring result(L"\"");
result += str;
if( str.back() == L'\\' )
result += L"\\";
result += L"\"";
return result;
}
示例3: reconnect
void ConnectedShortcut::reconnect(const wstring& settingsArgs)
{
if (!isConnected())
return;
wstring largs = CommandLineParser::joinArguments(getLArgs());
if (!settingsArgs.empty() && settingsArgs.back() != L' ')
largs.insert(largs.begin(), L' ');
m_pLink->SetArguments((settingsArgs + largs).data());
}
示例4: IS_STRING
bool JstrChecker::IS_STRING(const wstring &str, wstring &strvl) {
if (str.front() != JsonSymbol::STRING_BOUND || str.back() != JsonSymbol::STRING_BOUND) return false;
strvl = L"";
for (size_t i = 1; i < str.size() - 1; i++) {
if (str[i] == JsonSymbol::ESCAPE_SYM) {
if (i == str.size() - 2) return false;
strvl.push_back(ESCAPE(str[i + 1]));
i++;
} else if (str[i] == JsonSymbol::STRING_BOUND) {
return false;
} else {
strvl.push_back(str[i]);
}
}
return true;
}
示例5: connect
void ConnectedShortcut::connect(const wstring& settingsArgs)
{
if (isConnected())
return;
wstring args = getArguments();
wstring target = CommandLineParser::escapeArgument(getPath());
wstring description = SHORT_APP_NAME L" + " + getDescription();
wstring workingDirectory = getWorkingDirectory();
if (!args.empty())
target.push_back(L' ');
if (!settingsArgs.empty() && settingsArgs.back() != L' ')
target.insert(target.begin(), L' ');
// SetPath seems to change the working directory, too.
// We want to keep the original directory, however.
m_pLink->SetPath(getSelfPath().data());
m_pLink->SetArguments((settingsArgs + target + args).data());
m_pLink->SetDescription(description.data());
m_pLink->SetWorkingDirectory(workingDirectory.data());
m_isConnectedCachedResult = true;
}
示例6: ChkFolderPath
void ChkFolderPath(wstring& strPath)
{
if( strPath.empty() == false && strPath.back() == L'\\' ){
strPath.pop_back();
}
}
示例7: ExpandMacro
static BOOL ExpandMacro(wstring var, PLUGIN_RESERVE_INFO* info, EPG_EVENT_INFO* epgInfo, wstring& convert)
{
//����ς�
vector<wstring> funcStack;
while( !var.empty() && var.back() == L')' ){
size_t n = var.find(L'(');
if( n == wstring::npos ){
return FALSE;
}
funcStack.push_back(var.substr(0, n));
var = var.substr(n + 1, var.size() - 1 - (n + 1));
}
wstring strSDW28;
SYSTEMTIME t28TimeS;
if( 0 <= info->startTime.wHour && info->startTime.wHour < 4 ){
GetSumTime(info->startTime, -24*60*60, &t28TimeS);
GetDayOfWeekString2(t28TimeS, strSDW28);
t28TimeS.wHour+=24;
}else{
t28TimeS = info->startTime;
GetDayOfWeekString2(t28TimeS, strSDW28);
}
SYSTEMTIME tEnd;
GetI64Time(info->startTime, info->durationSec, NULL, NULL, &tEnd);
wstring strEDW28;
SYSTEMTIME t28TimeE;
if( 0 <= tEnd.wHour && tEnd.wHour < 4 ){
GetSumTime(tEnd, -24*60*60, &t28TimeE);
GetDayOfWeekString2(t28TimeE, strEDW28);
t28TimeE.wHour+=24;
}else{
t28TimeE = tEnd;
GetDayOfWeekString2(t28TimeE, strEDW28);
}
wstring ret;
if( var == L"Title" ) ret = info->eventName;
else if( var == L"SDYYYY" ) Format(ret, L"%04d", info->startTime.wYear);
else if( var == L"SDYY" ) Format(ret, L"%02d", info->startTime.wYear%100);
else if( var == L"SDMM" ) Format(ret, L"%02d", info->startTime.wMonth);
else if( var == L"SDM" ) Format(ret, L"%d", info->startTime.wMonth);
else if( var == L"SDDD" ) Format(ret, L"%02d", info->startTime.wDay);
else if( var == L"SDD" ) Format(ret, L"%d", info->startTime.wDay);
else if( var == L"SDW" ) GetDayOfWeekString2(info->startTime, ret);
else if( var == L"STHH" ) Format(ret, L"%02d", info->startTime.wHour);
else if( var == L"STH" ) Format(ret, L"%d", info->startTime.wHour);
else if( var == L"STMM" ) Format(ret, L"%02d", info->startTime.wMinute);
else if( var == L"STM" ) Format(ret, L"%d", info->startTime.wMinute);
else if( var == L"STSS" ) Format(ret, L"%02d", info->startTime.wSecond);
else if( var == L"STS" ) Format(ret, L"%d", info->startTime.wSecond);
else if( var == L"EDYYYY" ) Format(ret, L"%04d", tEnd.wYear);
else if( var == L"EDYY" ) Format(ret, L"%02d", tEnd.wYear%100);
else if( var == L"EDMM" ) Format(ret, L"%02d", tEnd.wMonth);
else if( var == L"EDM" ) Format(ret, L"%d", tEnd.wMonth);
else if( var == L"EDDD" ) Format(ret, L"%02d", tEnd.wDay);
else if( var == L"EDD" ) Format(ret, L"%d", tEnd.wDay);
else if( var == L"EDW" ) GetDayOfWeekString2(tEnd, ret);
else if( var == L"ETHH" ) Format(ret, L"%02d", tEnd.wHour);
else if( var == L"ETH" ) Format(ret, L"%d", tEnd.wHour);
else if( var == L"ETMM" ) Format(ret, L"%02d", tEnd.wMinute);
else if( var == L"ETM" ) Format(ret, L"%d", tEnd.wMinute);
else if( var == L"ETSS" ) Format(ret, L"%02d", tEnd.wSecond);
else if( var == L"ETS" ) Format(ret, L"%d", tEnd.wSecond);
else if( var == L"ONID10" ) Format(ret, L"%d", info->ONID);
else if( var == L"TSID10" ) Format(ret, L"%d", info->TSID);
else if( var == L"SID10" ) Format(ret, L"%d", info->SID);
else if( var == L"EID10" ) Format(ret, L"%d", info->EventID);
else if( var == L"ONID16" ) Format(ret, L"%04X", info->ONID);
else if( var == L"TSID16" ) Format(ret, L"%04X", info->TSID);
else if( var == L"SID16" ) Format(ret, L"%04X", info->SID);
else if( var == L"EID16" ) Format(ret, L"%04X", info->EventID);
else if( var == L"ServiceName" ) ret = info->serviceName;
else if( var == L"SDYYYY28" ) Format(ret, L"%04d", t28TimeS.wYear);
else if( var == L"SDYY28" ) Format(ret, L"%02d", t28TimeS.wYear%100);
else if( var == L"SDMM28" ) Format(ret, L"%02d", t28TimeS.wMonth);
else if( var == L"SDM28" ) Format(ret, L"%d", t28TimeS.wMonth);
else if( var == L"SDDD28" ) Format(ret, L"%02d", t28TimeS.wDay);
else if( var == L"SDD28" ) Format(ret, L"%d", t28TimeS.wDay);
else if( var == L"SDW28" ) ret = strSDW28;
else if( var == L"STHH28" ) Format(ret, L"%02d", t28TimeS.wHour);
else if( var == L"STH28" ) Format(ret, L"%d", t28TimeS.wHour);
else if( var == L"EDYYYY28" ) Format(ret, L"%04d", t28TimeE.wYear);
else if( var == L"EDYY28" ) Format(ret, L"%02d", t28TimeE.wYear%100);
else if( var == L"EDMM28" ) Format(ret, L"%02d", t28TimeE.wMonth);
else if( var == L"EDM28" ) Format(ret, L"%d", t28TimeE.wMonth);
else if( var == L"EDDD28" ) Format(ret, L"%02d", t28TimeE.wDay);
else if( var == L"EDD28" ) Format(ret, L"%d", t28TimeE.wDay);
else if( var == L"EDW28" ) ret = strEDW28;
else if( var == L"ETHH28" ) Format(ret, L"%02d", t28TimeE.wHour);
else if( var == L"ETH28" ) Format(ret, L"%d", t28TimeE.wHour);
else if( var == L"DUHH" ) Format(ret, L"%02d", info->durationSec/(60*60));
else if( var == L"DUH" ) Format(ret, L"%d", info->durationSec/(60*60));
else if( var == L"DUMM" ) Format(ret, L"%02d", (info->durationSec%(60*60))/60);
else if( var == L"DUM" ) Format(ret, L"%d", (info->durationSec%(60*60))/60);
else if( var == L"DUSS" ) Format(ret, L"%02d", info->durationSec%60);
else if( var == L"DUS" ) Format(ret, L"%d", info->durationSec%60);
else if( var == L"Title2" ){
//.........这里部分代码省略.........