Doxygen
ExprAstFilter类 参考

Class representing a filter in the AST 更多...

+ 类 ExprAstFilter 继承关系图:
+ ExprAstFilter 的协作图:

Public 成员函数

 ExprAstFilter (const QCString &name, ExprAstPtr &&arg)
 
const QCStringname () const
 
TemplateVariant apply (const TemplateVariant &v, TemplateContext *c)
 
- Public 成员函数 继承自 ExprAst
virtual ~ExprAst ()
 
virtual TemplateVariant resolve (TemplateContext *)
 

Private 属性

QCString m_name
 
ExprAstPtr m_arg
 

详细描述

Class representing a filter in the AST

在文件 template.cpp1734 行定义.

构造及析构函数说明

◆ ExprAstFilter()

ExprAstFilter::ExprAstFilter ( const QCString name,
ExprAstPtr &&  arg 
)
inline

在文件 template.cpp1737 行定义.

1737  : m_name(name), m_arg(std::move(arg))
1738  { TRACE(("ExprAstFilter(%s)\n",name.data())); }

引用了 QCString::data(), name() , 以及 TRACE.

成员函数说明

◆ apply()

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

在文件 template.cpp1740 行定义.

1741  {
1742  TemplateContextImpl *ci = dynamic_cast<TemplateContextImpl*>(c);
1743  if (ci==0) return v; // should not happen
1744  TRACE(("Applying filter '%s' to '%s' (type=%d)\n",qPrint(m_name),qPrint(v.toString()),v.type()));
1745  TemplateVariant arg;
1746  if (m_arg) arg = m_arg->resolve(c);
1747  bool ok;
1749  if (!ok)
1750  {
1751  ci->warn(ci->templateName(),ci->line(),"unknown filter '%s'",qPrint(m_name));
1752  }
1753  return result;
1754  }

引用了 TemplateFilterFactory::apply(), TemplateFilterFactory::instance(), TemplateContextImpl::line(), m_arg, m_name, qPrint(), TemplateContextImpl::templateName(), TemplateVariant::toString(), TRACE, TemplateVariant::type() , 以及 TemplateContextImpl::warn().

◆ name()

const QCString& ExprAstFilter::name ( ) const
inline

在文件 template.cpp1739 行定义.

1739 { return m_name; }

引用了 m_name.

被这些函数引用 ExprAstFilter().

类成员变量说明

◆ m_arg

ExprAstPtr ExprAstFilter::m_arg
private

在文件 template.cpp1757 行定义.

被这些函数引用 apply().

◆ m_name

QCString ExprAstFilter::m_name
private

在文件 template.cpp1756 行定义.

被这些函数引用 apply() , 以及 name().


该类的文档由以下文件生成:
TemplateContextImpl::warn
void warn(const QCString &fileName, int line, const char *fmt,...) const
Definition: template.cpp:2773
TemplateFilterFactory::apply
TemplateVariant apply(const QCString &name, const TemplateVariant &v, const TemplateVariant &arg, bool &ok)
Definition: template.cpp:1595
TemplateContextImpl::line
int line() const
Definition: template.cpp:685
TemplateVariant
Variant type which can hold one value of a fixed set of types.
Definition: template.h:98
TRACE
#define TRACE(x)
Definition: template.cpp:40
ExprAstFilter::m_name
QCString m_name
Definition: template.cpp:1756
TemplateFilterFactory::instance
static TemplateFilterFactory & instance()
Definition: template.cpp:1588
TemplateVariant::toString
QCString toString() const
Returns the variant as a string.
Definition: template.cpp:399
qPrint
const char * qPrint(const char *s)
Definition: qcstring.h:589
QCString::data
const char * data() const
Returns a pointer to the contents of the string in the form of a 0-terminated C string
Definition: qcstring.h:153
TemplateContextImpl
Internal class representing the implementation of a template context
Definition: template.cpp:640
ExprAstFilter::m_arg
ExprAstPtr m_arg
Definition: template.cpp:1757
ExprAstFilter::name
const QCString & name() const
Definition: template.cpp:1739
TemplateContextImpl::templateName
QCString templateName() const
Definition: template.cpp:684
TemplateVariant::type
constexpr Type type() const
Returns the type held by this variant
Definition: template.h:248