本文整理汇总了C++中LLControlVariable::isSaveValueDefault方法的典型用法代码示例。如果您正苦于以下问题:C++ LLControlVariable::isSaveValueDefault方法的具体用法?C++ LLControlVariable::isSaveValueDefault怎么用?C++ LLControlVariable::isSaveValueDefault使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLControlVariable
的用法示例。
在下文中一共展示了LLControlVariable::isSaveValueDefault方法的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)
{
llwarns << "Tried to save invalid control: " << iter->first << llendl;
}
if( control && control->isPersisted() )
{
if (!(nondefault_only && (control->isSaveValueDefault())))
{
settings[iter->first]["Type"] = typeEnumToString(control->type());
settings[iter->first]["Comment"] = control->getComment();
settings[iter->first]["Value"] = control->getSaveValue();
++num_saved;
}
else
{
// Debug spam
// llinfos << "Skipping " << control->getName() << llendl;
}
}
}
llofstream file;
file.open(filename);
if (file.is_open())
{
LLSDSerialize::toPrettyXML(settings, file);
file.close();
llinfos << "Saved to " << filename << llendl;
}
else
{
// This is a warning because sometime we want to use settings files which can't be written...
llwarns << "Unable to open settings file: " << filename << llendl;
return 0;
}
return num_saved;
}