本文整理汇总了C++中_tstring::empty方法的典型用法代码示例。如果您正苦于以下问题:C++ _tstring::empty方法的具体用法?C++ _tstring::empty怎么用?C++ _tstring::empty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类_tstring
的用法示例。
在下文中一共展示了_tstring::empty方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: IsUserCredentialsValid
const bool CUserInfo::IsUserCredentialsValid(const _tstring & sLogin, const _tstring & sPassword, _tstring& sPasswordHash) const
{
if (sLogin.empty() || sPassword.empty())
return false;
// Get user password hash
std::vector< unsigned char > vecCredentials;
vecCredentials.reserve(sLogin.size() + sPassword.size());
std::copy(sLogin.begin(), sLogin.end(), std::back_inserter(vecCredentials));
std::copy(sPassword.begin(), sPassword.end(), std::back_inserter(vecCredentials));
sPasswordHash = cmn::CCrypto::CalcMD5(&vecCredentials.front(), vecCredentials.size());
boost::mutex::scoped_lock Lock(m_mxData);
for (const auto& User : m_vecUsers)
{
if (!boost::algorithm::iequals(User.sLogin, sLogin))
continue;
if (!boost::algorithm::iequals(User.sPasswordHash, sPasswordHash))
continue;
return true;
}
return false;
}
示例2: sUpdateHelloMsg
/**
@brief 인삿말 UI를 업데이트 한다.
*/
void XWndSpot::sUpdateHelloMsg( XSpot *pSpot, const _tstring& strHello )
{
const ID idSpot = pSpot->GetidSpot();
auto pRoot = SCENE_WORLD->GetpLayerByProfilePictures(); // 프로필사진 전용레이어에 설치.
// 인삿말이 등록되어 있다면 출력.
if( !strHello.empty() ) {
if( pRoot ) {
auto pWndProfile = SafeCast2<XWndProfileForSpot*>( pRoot->Findf( "wnd.profile.%d", idSpot ) );
if( pWndProfile && !pWndProfile->IsShowProfile() )
pWndProfile = nullptr;
const auto vSpot = pSpot->GetpBaseProp()->vWorld;
// 프로필액자가 있으면 그위에 띄우고 없으면 스팟 바로위에 띄운다.
auto pWndHello = SafeCast2<XWndHello*>( pRoot->Findf( "wnd.hello.%d", idSpot ) );
if( pWndHello == nullptr ) {
pWndHello = new XWndHello( idSpot, vSpot );
pWndHello->SetstrIdentifierf( "wnd.hello.%d", idSpot );
pRoot->Add( pWndHello );
SCENE_WORLD->SetbUpdate( true );
}
pWndHello->SetText( strHello );
pWndHello->UpdatePos();
}
}
else {
// 인삿말이 없으면 윈도우 삭제.
pRoot->DestroyWndByIdentifierf( "wnd.hello.%d", idSpot );
}
}
示例3: LoadEach
xnBgObj::xProp* XPropBgObj::LoadEach( XEXmlNode& nodeEach, xtBgObj type, LPCTSTR szTag )
{
auto pProp = new xnBgObj::xProp();
pProp->m_idObj = (ID)nodeEach.GetInt( "id" );
if( XBREAK(pProp->m_idObj == 0) ) {
SAFE_DELETE( pProp );
return nullptr;
}
#ifdef _xIN_TOOL
s_idGlobal = std::max( pProp->m_idObj, s_idGlobal );
#endif // _xIN_TOOL
pProp->m_vwPos = nodeEach.GetVec2();
if( pProp->m_vwPos.IsInvalid() ) {
PROP_LOG("warning: invalid pos");
}
pProp->m_Type = type;
pProp->m_typeSub = 0;
// if( type == xBOT_SOUND ) {
// pProp->m_strSnd = nodeEach.GetTString( "file" );
// } else {
pProp->m_idAct = nodeEach.GetInt( "id_act" );
if( XBREAK( pProp->m_idAct == 0 ) ) {
PROP_LOG( "error: id_act is 0" );
}
// }
pProp->m_strSnd = nodeEach.GetTString("sound");
const _tstring strExt = XE::GetFileExt( pProp->m_strSnd );
if( !strExt.empty() ) {
pProp->m_strSnd = XE::GetFileTitle( pProp->m_strSnd );
}
return pProp;
}
示例4: OnStart
void XFSMMakeNewAccount::OnStart()
{
VALID_SOCK( pSockLogin, pSockGame );
//
const _tstring strtNick = m_pOwner->GetstrtNickGenerate();
XBREAK( strtNick.empty() );
XBREAK( !m_pOwner->GetstrName().empty() );
m_pOwner->SetstrName( strtNick );
pSockLogin->SendReqCreateAccount( strtNick );
}
示例5: Set
void CUserInfo::Set(const _tstring & sSessionId, const CUser & UserData)
{
boost::mutex::scoped_lock Lock(m_mxData);
if (!sSessionId.empty())
{
for (auto& User : m_vecUsers)
{
if (User.sSessionHash == sSessionId)
{
User = UserData;
Store();
return;
}
}
}
// Not found, adding
m_vecUsers.push_back(UserData);
}
示例6: CreateNote
HWND CApplication::CreateNote(_tstring const& sText /*= _tstring()*/, DWORD nFlag /*= NF_NONE*/)
{
CNoteWnd* pWnd = CreateNoteWnd(CalcNewNoteRect());
if (pWnd)
{
pWnd->SetInitFlags(nFlag);
pWnd->SetCreatedDate(dateutils::GetCurrentDateTime());
pWnd->SetFocus();
if (!sText.empty())
{
pWnd->SetText(sText);
pWnd->SetId(SaveNote(pWnd, NM_ALL)); // сохранить заметку, если указан текст
}
if ( nFlag & NF_ROLLUP )
{
pWnd->Rollup();
}
}
return pWnd != NULL ? pWnd->m_hWnd : NULL;
}
示例7: CreateSfx
/**
@brief 이펙트를 만드는 공통 함수.
@param secPlay 0:once 0>:해당시간동안 루핑 -1:무한루핑
@param vPos 값이 있다면 좌표를 기준으로 생성하고 없다면 this를 기준으로 생성한다.
*/
ID XSkillUser::CreateSfx( XSkillReceiver* pTarget,
const XSkillDat *pSkillDat,
const _tstring& strEffect,
ID idAct,
xtPoint pointSfx,
float secPlay,
const XE::VEC2& vPos )
{
if( strEffect.empty() )
return 0;
const float secLife = 0.f;
// 이펙트생성지점이 정해져있지 않으면 디폴트로 타겟 아래쪽에
if( pointSfx == xPT_NONE )
pointSfx = xPT_TARGET_BOTTOM;
if( idAct == 0 )
idAct = 1;
return OnCreateSkillSfx( pTarget,
pSkillDat,
pointSfx,
strEffect.c_str(),
idAct,
secPlay,
vPos );
}