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

Class representing an 'indexentry' tag in a template. More...

Inheritance diagram for TemplateNodeIndexEntry:
TemplateNodeCreator< TemplateNodeIndexEntry > TemplateNode

Classes

struct  Mapping
 

Public Member Functions

 TemplateNodeIndexEntry (TemplateParser *parser, TemplateNode *parent, int line, const QCString &data)
 
void render (FTextStream &, TemplateContext *c)
 
- Public Member Functions inherited from TemplateNodeCreator< TemplateNodeIndexEntry >
 TemplateNodeCreator (TemplateParser *parser, TemplateNode *parent, int line)
 
TemplateImplgetTemplate ()
 
- Public Member Functions inherited from TemplateNode
 TemplateNode (TemplateNode *parent)
 
virtual ~TemplateNode ()
 
TemplateNodeparent ()
 

Private Attributes

QCString m_name
 
QList< Mappingm_args
 

Additional Inherited Members

- Static Public Member Functions inherited from TemplateNodeCreator< TemplateNodeIndexEntry >
static TemplateNodecreateInstance (TemplateParser *parser, TemplateNode *parent, int line, const QCString &data)
 
- Protected Member Functions inherited from TemplateNodeCreator< TemplateNodeIndexEntry >
void mkpath (TemplateContextImpl *ci, const QCString &fileName)
 
- Protected Attributes inherited from TemplateNodeCreator< TemplateNodeIndexEntry >
QCString m_templateName
 
int m_line
 

Detailed Description

Class representing an 'indexentry' tag in a template.

Definition at line 3849 of file template.cpp.

Constructor & Destructor Documentation

TemplateNodeIndexEntry::TemplateNodeIndexEntry ( TemplateParser parser,
TemplateNode parent,
int  line,
const QCString &  data 
)
inline

Definition at line 3859 of file template.cpp.

References m_args, m_name, ExpressionParser::parse(), split(), TemplateParser::templateName(), TRACE, and TemplateParser::warn().

{
TRACE(("{TemplateNodeIndexEntry(%s)\n",data.data()));
m_args.setAutoDelete(TRUE);
ExpressionParser expParser(parser,line);
QValueList<QCString> args = split(data," ");
QValueListIterator<QCString> it = args.begin();
if (it==args.end() || (*it).find('=')!=-1)
{
parser->warn(parser->templateName(),line,"Missing name for indexentry tag");
}
else
{
m_name = *it;
++it;
while (it!=args.end())
{
QCString arg = *it;
int j=arg.find('=');
if (j>0)
{
ExprAst *expr = expParser.parse(arg.mid(j+1));
if (expr)
{
m_args.append(new Mapping(arg.left(j),expr));
}
}
else
{
parser->warn(parser->templateName(),line,"invalid argument '%s' for indexentry tag",arg.data());
}
++it;
}
}
TRACE(("}TemplateNodeIndexEntry(%s)\n",data.data()));
}

Member Function Documentation

void TemplateNodeIndexEntry::render ( FTextStream ,
TemplateContext c 
)
inlinevirtual

Implements TemplateNode.

Definition at line 3896 of file template.cpp.

References TemplateContextImpl::addIndexEntry(), m_args, TemplateNodeCreator< TemplateNodeIndexEntry >::m_line, m_name, TemplateNodeCreator< TemplateNodeIndexEntry >::m_templateName, TemplateNodeIndexEntry::Mapping::name, ExprAst::resolve(), TemplateContextImpl::setLocation(), and TemplateNodeIndexEntry::Mapping::value.

{
TemplateContextImpl *ci = dynamic_cast<TemplateContextImpl*>(c);
if (ci==0) return; // should not happen
if (!m_name.isEmpty())
{
QListIterator<Mapping> it(m_args);
Mapping *mapping;
QValueList<TemplateKeyValue> list;
for (it.toFirst();(mapping=it.current());++it)
{
list.append(TemplateKeyValue(mapping->name,mapping->value->resolve(c)));
}
ci->addIndexEntry(m_name,list);
}
}

Member Data Documentation

QList<Mapping> TemplateNodeIndexEntry::m_args
private

Definition at line 3915 of file template.cpp.

Referenced by render(), and TemplateNodeIndexEntry().

QCString TemplateNodeIndexEntry::m_name
private

Definition at line 3914 of file template.cpp.

Referenced by render(), and TemplateNodeIndexEntry().


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