本文整理汇总了C++中string::Left方法的典型用法代码示例。如果您正苦于以下问题:C++ string::Left方法的具体用法?C++ string::Left怎么用?C++ string::Left使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类string
的用法示例。
在下文中一共展示了string::Left方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: pathBaseName
/**
* @internal
* @brief Small Helper for extracting directory from a path
* @param sPath path
* @return directory part of the path
*/
static string pathBaseName( const string sPath )
{
string sRet = sPath; // fallback
size_t nEndPos = sPath.find_last_of( PATH_SEPERATOR );
if ( nEndPos != string::npos && nEndPos > 0 )
{
sRet = sPath.Left( nEndPos );
}
return sRet;
}
示例2: IsWhiteListed
//.........这里部分代码省略.........
WHITELIST("g_friendlyfireratio");
WHITELIST("g_mpHeadshotsOnly");
WHITELIST("g_mpNoVTOL");
WHITELIST("g_mpNoEnvironmentalWeapons");
WHITELIST("g_allowCustomLoadouts");
WHITELIST("g_allowFatalityBonus");
WHITELIST("g_modevarivar_proHud");
WHITELIST("g_modevarivar_disableKillCam");
WHITELIST("g_modevarivar_disableSpectatorCam");
WHITELIST("g_multiplayerDefault");
WHITELIST("g_allowExplosives");
WHITELIST("g_forceWeapon");
WHITELIST("g_allowWeaponCustomisation");
WHITELIST("g_infiniteCloak");
WHITELIST("g_infiniteAmmo");
WHITELIST("g_forceHeavyWeapon");
WHITELIST("g_forceLoadoutPackage");
WHITELIST("g_autoAssignTeams");
WHITELIST("gl_initialTime");
WHITELIST("gl_time");
WHITELIST("g_gameRules_startTimerLength");
WHITELIST("sv_maxPlayers");
WHITELIST("g_switchTeamAllowed");
WHITELIST("g_switchTeamRequiredPlayerDifference");
WHITELIST("g_switchTeamUnbalancedWarningDifference");
WHITELIST("g_switchTeamUnbalancedWarningTimer");
WHITELIST("http_startserver");
WHITELIST("http_stopserver");
WHITELIST("http_password");
WHITELIST("rcon_startserver");
WHITELIST("rcon_stopserver");
WHITELIST("rcon_password");
WHITELIST("gl_StartGame");
WHITELIST("g_messageOfTheDay");
WHITELIST("g_serverImageUrl");
WHITELIST("log_Verbosity");
WHITELIST("log_WriteToFile");
WHITELIST("log_WriteToFileVerbosity");
WHITELIST("log_IncludeTime");
WHITELIST("log_tick");
WHITELIST("net_log");
WHITELIST("g_pinglimit");
WHITELIST("g_pingLimitTimer");
WHITELIST("g_tk_punish");
WHITELIST("g_tk_punish_limit");
WHITELIST("g_idleKickTime");
WHITELIST("net_reserved_slot_system");
WHITELIST("net_add_reserved_slot");
WHITELIST("net_remove_reserved_slot");
WHITELIST("net_list_reserved_slot");
WHITELIST("sv_votingCooldown");
WHITELIST("sv_votingRatio");
WHITELIST("sv_votingTimeout");
WHITELIST("sv_votingEnable");
WHITELIST("sv_votingBanTime");
WHITELIST("g_dataRefreshFrequency");
WHITELIST("g_quitOnNewDataFound");
WHITELIST("g_quitNumRoundsWarning");
WHITELIST("g_allowedDataPatchFailCount");
WHITELIST("g_shutdownMessageRepeatTime");
WHITELIST("g_shutdownMessage");
WHITELIST("g_patchPakDediServerMustPatch");
WHITELIST("g_server_region");
WHITELIST("net_log_dirtysock");
#endif
WHITELIST("sys_user_folder");
WHITELIST("sys_screensaver_allowed");
WHITELIST("sys_UncachedStreamReads");
if (!silent)
{
string temp = command.Left(command.find(' '));
if (temp.empty())
{
temp = command;
}
#if defined(DEDICATED_SERVER)
CryLogAlways("[Warning] Unknown command: %s", temp.c_str());
#else
CryLog("[Warning] Unknown command: %s", temp.c_str());
#endif
}
return false;
}