本文整理汇总了C++中CSettingInt::SetVisible方法的典型用法代码示例。如果您正苦于以下问题:C++ CSettingInt::SetVisible方法的具体用法?C++ CSettingInt::SetVisible怎么用?C++ CSettingInt::SetVisible使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSettingInt
的用法示例。
在下文中一共展示了CSettingInt::SetVisible方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AddSetting
void CPeripheral::AddSetting(const std::string &strKey, const CSetting *setting, int order)
{
if (!setting)
{
CLog::Log(LOGERROR, "%s - invalid setting", __FUNCTION__);
return;
}
if (!HasSetting(strKey))
{
PeripheralDeviceSetting deviceSetting = { NULL, order };
switch(setting->GetType())
{
case SettingTypeBool:
{
const CSettingBool *mappedSetting = (const CSettingBool *) setting;
CSettingBool *boolSetting = new CSettingBool(strKey, *mappedSetting);
if (boolSetting)
{
boolSetting->SetVisible(mappedSetting->IsVisible());
deviceSetting.m_setting = boolSetting;
}
}
break;
case SettingTypeInteger:
{
const CSettingInt *mappedSetting = (const CSettingInt *) setting;
CSettingInt *intSetting = new CSettingInt(strKey, *mappedSetting);
if (intSetting)
{
intSetting->SetVisible(mappedSetting->IsVisible());
deviceSetting.m_setting = intSetting;
}
}
break;
case SettingTypeNumber:
{
const CSettingNumber *mappedSetting = (const CSettingNumber *) setting;
CSettingNumber *floatSetting = new CSettingNumber(strKey, *mappedSetting);
if (floatSetting)
{
floatSetting->SetVisible(mappedSetting->IsVisible());
deviceSetting.m_setting = floatSetting;
}
}
break;
case SettingTypeString:
{
const CSettingString *mappedSetting = (const CSettingString *) setting;
CSettingString *stringSetting = new CSettingString(strKey, *mappedSetting);
if (stringSetting)
{
stringSetting->SetVisible(mappedSetting->IsVisible());
deviceSetting.m_setting = stringSetting;
}
}
break;
default:
//! @todo add more types if needed
break;
}
if (deviceSetting.m_setting != NULL)
m_settings.insert(make_pair(strKey, deviceSetting));
}
}
示例2: AddSetting
void CPeripheral::AddSetting(const CStdString &strKey, const CSetting *setting)
{
if (!setting)
{
CLog::Log(LOGERROR, "%s - invalid setting", __FUNCTION__);
return;
}
if (!HasSetting(strKey))
{
switch(setting->GetType())
{
case SettingTypeBool:
{
const CSettingBool *mappedSetting = (const CSettingBool *) setting;
CSettingBool *boolSetting = new CSettingBool(strKey, *mappedSetting);
if (boolSetting)
{
boolSetting->SetVisible(mappedSetting->IsVisible());
m_settings.insert(make_pair(strKey, boolSetting));
}
}
break;
case SettingTypeInteger:
{
const CSettingInt *mappedSetting = (const CSettingInt *) setting;
CSettingInt *intSetting = new CSettingInt(strKey, *mappedSetting);
if (intSetting)
{
intSetting->SetVisible(mappedSetting->IsVisible());
m_settings.insert(make_pair(strKey, intSetting));
}
}
break;
case SettingTypeNumber:
{
const CSettingNumber *mappedSetting = (const CSettingNumber *) setting;
CSettingNumber *floatSetting = new CSettingNumber(strKey, *mappedSetting);
if (floatSetting)
{
floatSetting->SetVisible(mappedSetting->IsVisible());
m_settings.insert(make_pair(strKey, floatSetting));
}
}
break;
case SettingTypeString:
{
const CSettingString *mappedSetting = (const CSettingString *) setting;
CSettingString *stringSetting = new CSettingString(strKey, *mappedSetting);
if (stringSetting)
{
stringSetting->SetVisible(mappedSetting->IsVisible());
m_settings.insert(make_pair(strKey, stringSetting));
}
}
break;
default:
//TODO add more types if needed
break;
}
}
}