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

The implementation of the "divisibleby" filter. More...

Static Public Member Functions

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

Detailed Description

The implementation of the "divisibleby" filter.

Definition at line 1267 of file template.cpp.

Member Function Documentation

static TemplateVariant FilterDivisibleBy::apply ( const TemplateVariant v,
const TemplateVariant n 
)
inlinestatic

Definition at line 1270 of file template.cpp.

References TemplateVariant::Integer, TemplateVariant::isValid(), TemplateVariant::toInt(), and TemplateVariant::type().

{
if (!v.isValid() || !n.isValid())
{
return TemplateVariant();
}
{
int ni = n.toInt();
if (ni>0)
{
return TemplateVariant((v.toInt()%ni)==0);
}
else
{
return TemplateVariant(FALSE);
}
}
else
{
return TemplateVariant();
}
}

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