本文整理汇总了C++中LLControlVariable::getComment方法的典型用法代码示例。如果您正苦于以下问题:C++ LLControlVariable::getComment方法的具体用法?C++ LLControlVariable::getComment怎么用?C++ LLControlVariable::getComment使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLControlVariable
的用法示例。
在下文中一共展示了LLControlVariable::getComment方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例2: connectCOAVars
void LLControlGroup::connectCOAVars(LLControlGroup &OtherGroup)
{
LLControlVariable *pCOAVar = NULL;
for (ctrl_name_table_t::iterator iter = mNameTable.begin();
iter != mNameTable.end(); iter++)
{
if(iter->second->isCOA())
{
LLControlVariable *pParent = iter->second;
LLControlVariable *pChild = OtherGroup.getControl(pParent->getName());
if(!pChild)
{
OtherGroup.declareControl(
pParent->getName(),
pParent->type(),
pParent->getDefault(),
pParent->getComment(),
pParent->isPersisted(),
true);
pChild = OtherGroup.getControl(pParent->getName());
}
if(pChild)
{
pParent->setCOAConnect(pChild,true);
pChild->setCOAConnect(pParent,false);
}
}
else if(iter->second->getName() == "AscentStoreSettingsPerAccount")
pCOAVar = iter->second;
}
if(pCOAVar)
{
pCOAVar->getSignal()->connect(boost::bind(&LLControlGroup::handleCOASettingChange, this, _2));
pCOAVar->firePropertyChanged();
}
}
示例3: 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;
}