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

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

Static Public Member Functions

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

Static Private Member Functions

static void flatten (TemplateListIntf *tree, TemplateList *list)
 

Detailed Description

The implementation of the "flatten" filter.

Definition at line 822 of file template.cpp.

Member Function Documentation

static TemplateVariant FilterFlatten::apply ( const TemplateVariant v,
const TemplateVariant  
)
inlinestatic
static void FilterFlatten::flatten ( TemplateListIntf tree,
TemplateList list 
)
inlinestaticprivate

Definition at line 840 of file template.cpp.

References TemplateList::append(), TemplateListIntf::createIterator(), TemplateListIntf::ConstIterator::current(), TemplateStructIntf::get(), TemplateVariant::isValid(), TemplateVariant::List, TemplateListIntf::ConstIterator::toFirst(), TemplateVariant::toList(), TemplateListIntf::ConstIterator::toNext(), TemplateVariant::toStruct(), and TemplateVariant::type().

Referenced by apply().

{
for (it->toFirst();(it->current(item));it->toNext())
{
if (s)
{
list->append(item);
// if s has "children" then recurse into the children
TemplateVariant children = s->get("children");
if (children.isValid() && children.type()==TemplateVariant::List)
{
flatten(children.toList(),list);
}
}
else
{
list->append(item);
}
}
delete it;
}

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