本文整理汇总了C++中DynamicStringSettingOptions::size方法的典型用法代码示例。如果您正苦于以下问题:C++ DynamicStringSettingOptions::size方法的具体用法?C++ DynamicStringSettingOptions::size怎么用?C++ DynamicStringSettingOptions::size使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DynamicStringSettingOptions
的用法示例。
在下文中一共展示了DynamicStringSettingOptions::size方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UpdateDynamicOptions
DynamicStringSettingOptions CSettingString::UpdateDynamicOptions()
{
CExclusiveLock lock(m_critical);
DynamicStringSettingOptions options;
if (m_optionsFiller == NULL &&
(m_optionsFillerName.empty() || m_settingsManager == NULL))
return options;
if (m_optionsFiller == NULL)
{
m_optionsFiller = (StringSettingOptionsFiller)m_settingsManager->GetSettingOptionsFiller(this);
if (m_optionsFiller == NULL)
return options;
}
std::string bestMatchingValue = m_value;
m_optionsFiller(this, options, bestMatchingValue, m_optionsFillerData);
if (bestMatchingValue != m_value)
SetValue(bestMatchingValue);
// check if the list of items has changed
bool changed = m_dynamicOptions.size() != options.size();
if (!changed)
{
for (size_t index = 0; index < options.size(); index++)
{
if (options[index].first.compare(m_dynamicOptions[index].first) != 0 ||
options[index].second.compare(m_dynamicOptions[index].second) != 0)
{
changed = true;
break;
}
}
}
if (changed)
{
m_dynamicOptions = options;
OnSettingPropertyChanged(this, "options");
}
return options;
}