本文整理汇总了C++中LLControlVariable::setPersist方法的典型用法代码示例。如果您正苦于以下问题:C++ LLControlVariable::setPersist方法的具体用法?C++ LLControlVariable::setPersist怎么用?C++ LLControlVariable::setPersist使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLControlVariable
的用法示例。
在下文中一共展示了LLControlVariable::setPersist方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onSetDebug
// Checked: 2009-10-10 (RLVa-1.0.4e) | Modified: RLVa-1.0.4e
ERlvCmdRet RlvExtGetSet::onSetDebug(std::string strSetting, const std::string& strValue)
{
S16 dbgFlags; ERlvCmdRet eRet = RLV_RET_FAILED_UNKNOWN;
if ( (findDebugSetting(strSetting, dbgFlags)) && ((dbgFlags & DBG_WRITE) == DBG_WRITE) )
{
eRet = RLV_RET_FAILED_OPTION;
if ((dbgFlags & DBG_PSEUDO) == 0)
{
LLControlVariable* pSetting = gSavedSettings.getControl(strSetting);
if (pSetting)
{
U32 u32Value; S32 s32Value; BOOL fValue;
switch (pSetting->type())
{
case TYPE_U32:
if (LLStringUtil::convertToU32(strValue, u32Value))
{
gSavedSettings.setU32(strSetting, u32Value);
eRet = RLV_RET_SUCCESS;
}
break;
case TYPE_S32:
if (LLStringUtil::convertToS32(strValue, s32Value))
{
gSavedSettings.setS32(strSetting, s32Value);
eRet = RLV_RET_SUCCESS;
}
break;
case TYPE_BOOLEAN:
if (LLStringUtil::convertToBOOL(strValue, fValue))
{
gSavedSettings.setBOOL(strSetting, fValue);
eRet = RLV_RET_SUCCESS;
}
break;
default:
RLV_ERRS << "Unexpected debug setting type" << LL_ENDL;
eRet = RLV_RET_FAILED;
break;
}
// Default settings should persist if they were marked that way, but non-default settings should never persist
pSetting->setPersist( (pSetting->isDefault()) ? ((dbgFlags & DBG_PERSIST) == DBG_PERSIST) : false );
}
}
else
{
eRet = onSetPseudoDebug(strSetting, strValue);
}
}
return eRet;
}