My Project
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Attributes | List of all members
ExprAstFilter Class Reference

Class representing a filter in the AST. More...

Inheritance diagram for ExprAstFilter:
ExprAst

Public Member Functions

 ExprAstFilter (const char *name, ExprAst *arg)
 
 ~ExprAstFilter ()
 
const QCString & name () const
 
TemplateVariant apply (const TemplateVariant &v, TemplateContext *c)
 
- Public Member Functions inherited from ExprAst
virtual ~ExprAst ()
 
virtual TemplateVariant resolve (TemplateContext *)
 

Private Attributes

QCString m_name
 
ExprAstm_arg
 

Detailed Description

Class representing a filter in the AST.

Definition at line 1505 of file template.cpp.

Constructor & Destructor Documentation

ExprAstFilter::ExprAstFilter ( const char *  name,
ExprAst arg 
)
inline

Definition at line 1508 of file template.cpp.

References TRACE.

: m_name(name), m_arg(arg)
{ TRACE(("ExprAstFilter(%s)\n",name)); }
ExprAstFilter::~ExprAstFilter ( )
inline

Definition at line 1510 of file template.cpp.

References m_arg.

{ delete m_arg; }

Member Function Documentation

TemplateVariant ExprAstFilter::apply ( const TemplateVariant v,
TemplateContext c 
)
inline

Definition at line 1512 of file template.cpp.

References TemplateFilterFactory::apply(), TemplateFilterFactory::instance(), TemplateContextImpl::line(), m_arg, m_name, ExprAst::resolve(), TemplateContextImpl::templateName(), TemplateVariant::toString(), TRACE, TemplateVariant::type(), and TemplateContextImpl::warn().

Referenced by ExprAstFilterAppl::resolve().

{
TemplateContextImpl *ci = dynamic_cast<TemplateContextImpl*>(c);
if (ci==0) return v; // should not happen
TRACE(("Applying filter '%s' to '%s' (type=%d)\n",m_name.data(),v.toString().data(),v.type()));
if (m_arg) arg = m_arg->resolve(c);
bool ok;
if (!ok)
{
ci->warn(ci->templateName(),ci->line(),"unknown filter '%s'",m_name.data());
}
return result;
}
const QCString& ExprAstFilter::name ( ) const
inline

Definition at line 1511 of file template.cpp.

References m_name.

{ return m_name; }

Member Data Documentation

ExprAst* ExprAstFilter::m_arg
private

Definition at line 1529 of file template.cpp.

Referenced by apply(), and ~ExprAstFilter().

QCString ExprAstFilter::m_name
private

Definition at line 1528 of file template.cpp.

Referenced by apply(), and name().


The documentation for this class was generated from the following file: