Doxygen
FilterLength类 参考

The implementation of the "length" filter 更多...

静态 Public 成员函数

static TemplateVariant apply (const TemplateVariant &v, const TemplateVariant &)
 

详细描述

The implementation of the "length" filter

在文件 template.cpp965 行定义.

成员函数说明

◆ apply()

static TemplateVariant FilterLength::apply ( const TemplateVariant v,
const TemplateVariant  
)
inlinestatic

在文件 template.cpp968 行定义.

969  {
970  if (!v.isValid())
971  {
972  return TemplateVariant();
973  }
974  if (v.isList())
975  {
976  return TemplateVariant((int)v.toList()->count());
977  }
978  else if (v.isString())
979  {
980  return TemplateVariant((int)v.toString().length());
981  }
982  else
983  {
984  return TemplateVariant();
985  }
986  }

引用了 TemplateVariant::isList(), TemplateVariant::isString(), TemplateVariant::isValid(), QCString::length(), TemplateVariant::toList() , 以及 TemplateVariant::toString().


该类的文档由以下文件生成:
TemplateVariant::isList
constexpr bool isList() const
Returns TRUE if the variant holds a list value
Definition: template.h:213
QCString::length
uint length() const
Returns the length of the string, not counting the 0-terminator.
Definition: qcstring.h:147
TemplateVariant
Variant type which can hold one value of a fixed set of types.
Definition: template.h:98
TemplateVariant::toString
QCString toString() const
Returns the variant as a string.
Definition: template.cpp:399
TemplateVariant::isValid
constexpr bool isValid() const
Returns TRUE if the variant holds a valid value, or FALSE otherwise
Definition: template.h:203
TemplateVariant::toList
TemplateListIntfPtr toList()
Returns the pointer to list referenced by this variant or 0 if this variant does not have list type.
Definition: template.cpp:432
TemplateVariant::isString
constexpr bool isString() const
Returns TRUE if the variant holds a string value
Definition: template.h:209