本文整理汇总了C++中PProperty::GetChildFromParent方法的典型用法代码示例。如果您正苦于以下问题:C++ PProperty::GetChildFromParent方法的具体用法?C++ PProperty::GetChildFromParent怎么用?C++ PProperty::GetChildFromParent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PProperty
的用法示例。
在下文中一共展示了PProperty::GetChildFromParent方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ParseProperty
bool TemplateParser::ParseProperty()
{
wxString childName;
wxString propname = ParsePropertyName( &childName );
PProperty property = m_obj->GetProperty(propname);
if ( NULL == property.get() )
{
wxLogError( wxT("The property '%s' does not exist for objects of class '%s'"), propname.c_str(), m_obj->GetClassName().c_str() );
return true;
}
if ( childName.empty() )
{
wxString code = PropertyToCode(property);
m_out << code;
}
else
{
m_out << property->GetChildFromParent( childName );
}
// LogDebug("parsing property %s",propname.c_str());
return true;
}
示例2: GetChildFromParentProperty
wxString ObjectBase::GetChildFromParentProperty( const wxString& parentName, const wxString& childName )
{
PProperty property = GetProperty( parentName );
if (property)
return property->GetChildFromParent( childName );
else
return wxEmptyString;
}
示例3: GenEvents
void PHPCodeGenerator::GenEvents( PObjectBase class_obj, const EventVector &events, bool disconnect )
{
if ( events.empty() )
{
return;
}
if( disconnect )
{
m_source->WriteLn( wxT("// Disconnect Events") );
}
else
{
m_source->WriteLn();
m_source->WriteLn( wxT("// Connect Events") );
}
PProperty propName = class_obj->GetProperty( wxT("name") );
if ( !propName )
{
wxLogError(wxT("Missing \"name\" property on \"%s\" class. Review your XML object description"),
class_obj->GetClassName().c_str());
return;
}
wxString class_name = propName->GetValue();
if ( class_name.empty() )
{
wxLogError( wxT("Object name cannot be null") );
return;
}
wxString base_class;
wxString handlerName;
PProperty propSubclass = class_obj->GetProperty( wxT("subclass") );
if ( propSubclass )
{
wxString subclass = propSubclass->GetChildFromParent( wxT("name") );
if ( !subclass.empty() )
{
base_class = subclass;
}
}
if ( base_class.empty() )
base_class = wxT("wx") + class_obj->GetClassName();
if ( events.size() > 0 )
{
for ( size_t i = 0; i < events.size(); i++ )
{
PEvent event = events[i];
handlerName = event->GetValue();
wxString templateName = wxString::Format( wxT("connect_%s"), event->GetName().c_str() );
PObjectBase obj = event->GetObject();
if ( !GenEventEntry( obj, obj->GetObjectInfo(), templateName, handlerName, disconnect ) )
{
wxLogError( wxT("Missing \"evt_%s\" template for \"%s\" class. Review your XML object description"),
templateName.c_str(), class_name.c_str() );
}
}
}
}