本文整理汇总了C++中std::wstring::rbegin方法的典型用法代码示例。如果您正苦于以下问题:C++ wstring::rbegin方法的具体用法?C++ wstring::rbegin怎么用?C++ wstring::rbegin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类std::wstring
的用法示例。
在下文中一共展示了wstring::rbegin方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: StartUpdate
bool CGameUpdate::StartUpdate(DWORD gid, LPCWSTR tid, LPCWSTR src, LPCWSTR dst, DWORD flag, LPCSTR svrip, LPCSTR cliip, DWORD maxspeed, DWORD type)
{
StopUpdate();
ZeroMemory(&m_UpdateStuats, sizeof(m_UpdateStuats));
m_UpdateStuats.cbSize = sizeof(m_UpdateStuats);
m_dwGid = gid;
m_dwUptType = type;
if(tid!= NULL && wcslen(tid) < MAX_GUID_LEN)
{
_tcscpy_s(m_szTid, CW2T(tid));
}
if (maxspeed)
//m_dwMaxSpeed = (maxspeed < 1000) ? 640 : ((maxspeed - 200) * 1000);
{
if (maxspeed * .2 < 200)
{
m_dwMaxSpeed = max(DWORD(maxspeed * .8) * 1024, 640);
}
else
{
m_dwMaxSpeed = (maxspeed - 200) * 1024;
}
}
//check parameter
if (src == NULL || dst == NULL || wcslen(src) < 2 || wcslen(dst) < 2 ||
src[1] != L':' || src[2] != L'\\' ||
dst[1] != L':' || dst[2] != L'\\')
{
SetErrorInfo(UPT_ERR_DIRNOTOK, src, dst);
return false;
}
//save parameter.
m_strSvrPath = src; m_strCliPath = dst;
if (svrip != NULL) m_strSvrIp = svrip;
if (cliip != NULL) m_strCliIp = cliip;
m_dwUptFlag = flag;
if (*m_strSvrPath.rbegin() != L'\\')
m_strSvrPath += L"\\";
if (*m_strCliPath.rbegin() != L'\\')
m_strCliPath += L"\\";
//convert and create directory.
if (!hy_LoadVirtualDevice(m_strCliPath[0]))
{
SetErrorInfo(UPT_ERR_LOADDEVICE);
return false;
}
m_strDevPath = hy_ConvertPath(m_strCliPath);
if (!hy_CreateDirectory(m_strCliPath) || !hy_CreateDirectory(m_strDevPath))
{
SetErrorInfo(UPT_ERR_CREATEDIR, m_strCliPath.c_str());
return false;
}
//create update work thread.
m_hExited = CreateEvent(NULL, TRUE, FALSE, NULL);
if (m_hExited == NULL)
{
SetErrorInfo(UPT_ERR_INNERERR, GetLastError());
return false;
}
// 暂停事件
if( !m_eventRun.Create(0, TRUE, TRUE) )
{
SetErrorInfo(UPT_ERR_INNERERR, GetLastError());
return false;
}
m_pipe = new PCMomule<tagIdxBlock*>(m_hExited);
m_pipe2 = new PCMomule<tagIdxBlock*>(m_hExited);
m_hThread = (HANDLE)_beginthreadex(NULL, 0, WorkThread, this, 0, NULL);
if (m_hThread == NULL)
{
SetErrorInfo(UPT_ERR_INNERERR, GetLastError());
StopUpdate();
return false;
}
return true;
}
示例2: TrimEnd
std::wstring TrimEnd(std::wstring s)
{
s.erase(std::find_if(s.rbegin(), s.rend(),
std::not1(std::ptr_fun<int, int>(std::isspace))).base(), s.end());
return s;
}