Esempio n. 1
0
TemplateData Field::CompileTemplate(const ReflectionParser *context) const
{
    TemplateData data = { TemplateData::Type::Object };

    data[ "name" ] = m_name;
    data[ "displayName" ] = m_displayName;
    data[ "type" ] = m_type;

    data[ "hasParent" ] = utils::TemplateBool( !!m_parent );

    data[ "parentQualifiedName" ] = m_parent->m_qualifiedName;

    // getter

    data[ "isGetterAccessible" ] = utils::TemplateBool( isGetterAccessible( ) );
    data[ "hasExplicitGetter" ] = utils::TemplateBool( m_hasExplicitGetter );
    data[ "explicitGetter" ] = m_explicitGetter;
    data[ "getterBody" ] = context->LoadTemplatePartial( kPartialFieldGetter );

    // setter

    data[ "isSetterAccessible" ] = utils::TemplateBool( isSetterAccessible( ) );
    data[ "hasExplicitSetter" ] = utils::TemplateBool( m_hasExplicitSetter );
    data[ "explicitSetter" ] = m_explicitSetter;
    data[ "setterBody" ] = context->LoadTemplatePartial( kPartialFieldSetter );

    m_metaData.CompileTemplateData( data, context );

    return data;
}
Esempio n. 2
0
bool Global::isAccessible(void) const
{
    return isGetterAccessible( ) || isSetterAccessible( );
}