本文整理汇总了C++中Property::GetBoolean方法的典型用法代码示例。如果您正苦于以下问题:C++ Property::GetBoolean方法的具体用法?C++ Property::GetBoolean怎么用?C++ Property::GetBoolean使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Property
的用法示例。
在下文中一共展示了Property::GetBoolean方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetProperty
//----------------------------------------------------------------
void PropertyList::SetProperty(const wxString& propname, const Property& prop)
/**
* \brief Sets the property with the given name. If the property does
* not exists the property will be created. If the property already exists
* the property will be overridden.
* \param propname The property name.
* \param prop The property.
**/
{
Property* setprop = GetProperty(propname, true);
if (setprop->GetType() != prop.GetType())
{
setprop->SetType(prop.GetType());
setprop->SetName(prop.GetName());
}
switch (setprop->GetType())
{
case penvPT_Boolean:
setprop->SetBoolean(prop.GetBoolean());
break;
case penvPT_Integer:
setprop->SetInteger(prop.GetInteger());
break;
case penvPT_Double:
setprop->SetDouble(prop.GetDouble());
break;
case penvPT_String:
setprop->SetString(prop.GetString());
break;
case penvPT_Properties:
setprop->SetPropertyList(prop.GetPropertyList());
break;
case penvPT_ArrayBoolean:
NOT_IMPLEMENTED_YET();
break;
case penvPT_ArrayInteger:
NOT_IMPLEMENTED_YET();
break;
case penvPT_ArrayDouble:
NOT_IMPLEMENTED_YET();
break;
case penvPT_ArrayString:
NOT_IMPLEMENTED_YET();
break;
default:
wxString msg = wxString::Format(_T("Unknown type for property %s."), setprop->GetName().c_str());
break;
}
}
示例2: GetBoolean
//----------------------------------------------------------------
bool PropertyList::GetBoolean(const wxString& propname)
/**
* \brief Returns the double value from a known property.
* The method returns false if the property does not exists and
* a error will be generated.
* \param propname The property name.
* \return Value of that property.
**/
{
Property* prop = GetProperty(propname, false);
if (prop == NULL) {
wxLogError(_T("[penv::PropertyList::GetBoolean] The property '%s' does not exists."), propname.c_str());
return (false);
}
return (prop->GetBoolean());
}