本文整理汇总了C++中LLControlVariable::isBackupable方法的典型用法代码示例。如果您正苦于以下问题:C++ LLControlVariable::isBackupable方法的具体用法?C++ LLControlVariable::isBackupable怎么用?C++ LLControlVariable::isBackupable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLControlVariable
的用法示例。
在下文中一共展示了LLControlVariable::isBackupable方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: saveToFile
U32 LLControlGroup::saveToFile(const std::string& filename, BOOL nondefault_only)
{
LLSD settings;
int num_saved = 0;
for (ctrl_name_table_t::iterator iter = mNameTable.begin();
iter != mNameTable.end(); iter++)
{
LLControlVariable* control = iter->second;
if (!control)
{
LL_WARNS("Settings") << "Tried to save invalid control: " << iter->first << LL_ENDL;
}
else if( control->shouldSave(nondefault_only) )
{
settings[iter->first]["Type"] = typeEnumToString(control->type());
settings[iter->first]["Comment"] = control->getComment();
settings[iter->first]["Value"] = control->getSaveValue();
settings[iter->first]["Backup"] = control->isBackupable(); // <FS:Zi> Backup Settings
++num_saved;
}
}
llofstream file;
file.open(filename.c_str());
if (file.is_open())
{
LLSDSerialize::toPrettyXML(settings, file);
file.close();
LL_INFOS("Settings") << "Saved to " << filename << LL_ENDL;
}
else
{
// This is a warning because sometime we want to use settings files which can't be written...
LL_WARNS("Settings") << "Unable to open settings file: " << filename << LL_ENDL;
return 0;
}
return num_saved;
}