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 3709 of file template.cpp.

Constructor & Destructor Documentation

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

Definition at line 3719 of file template.cpp.

3721  {
3722  TRACE(("{TemplateNodeIndexEntry(%s)\n",data.data()));
3723  m_args.setAutoDelete(TRUE);
3724  ExpressionParser expParser(parser,line);
3725  QValueList<QCString> args = split(data," ");
3726  QValueListIterator<QCString> it = args.begin();
3727  if (it==args.end() || (*it).find('=')!=-1)
3728  {
3729  parser->warn(parser->templateName(),line,"Missing name for indexentry tag");
3730  }
3731  else
3732  {
3733  m_name = *it;
3734  ++it;
3735  while (it!=args.end())
3736  {
3737  QCString arg = *it;
3738  int j=arg.find('=');
3739  if (j>0)
3740  {
3741  ExprAst *expr = expParser.parse(arg.mid(j+1));
3742  if (expr)
3743  {
3744  m_args.append(new Mapping(arg.left(j),expr));
3745  }
3746  }
3747  else
3748  {
3749  parser->warn(parser->templateName(),line,"invalid argument '%s' for indexentry tag",arg.data());
3750  }
3751  ++it;
3752  }
3753  }
3754  TRACE(("}TemplateNodeIndexEntry(%s)\n",data.data()));
3755  }
static QValueList< QCString > split(const QCString &str, const QCString &sep, bool allowEmptyEntries=FALSE, bool cleanup=TRUE)
Definition: template.cpp:50
Iterator end()
Definition: qvaluelist.h:363
QCString left(uint len) const
Definition: qcstring.cpp:213
int find(char c, int index=0, bool cs=TRUE) const
Definition: qcstring.cpp:41
static QCString args
Definition: declinfo.cpp:674
TemplateNode * parent()
Definition: template.cpp:1647
QList< Mapping > m_args
Definition: template.cpp:3775
Base class for all nodes in the abstract syntax tree of an expression.
Definition: template.cpp:1364
const char * data() const
Definition: qcstring.h:207
QCString mid(uint index, uint len=0xffffffff) const
Definition: qcstring.cpp:246
std::vector< size_t > Mapping(std::vector< geo::AuxDetGeo * > &adgeo)
void line(double t, double *p, double &x, double &y, double &z)
Iterator begin()
Definition: qvaluelist.h:361
Recursive decent parser for Django style template expressions.
Definition: template.cpp:1680
#define TRACE(x)
Definition: template.cpp:43
const bool TRUE
Definition: qglobal.h:371

Member Function Documentation

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

Implements TemplateNode.

Definition at line 3756 of file template.cpp.

3757  {
3758  TemplateContextImpl *ci = dynamic_cast<TemplateContextImpl*>(c);
3759  if (ci==0) return; // should not happen
3760  if (!m_name.isEmpty())
3761  {
3764  Mapping *mapping;
3766  for (it.toFirst();(mapping=it.current());++it)
3767  {
3768  list.append(TemplateKeyValue(mapping->name,mapping->value->resolve(c)));
3769  }
3770  ci->addIndexEntry(m_name,list);
3771  }
3772  }
Iterator append(const T &x)
Definition: qvaluelist.h:372
bool isEmpty() const
Definition: qcstring.h:189
Internal class representing the implementation of a template context.
Definition: template.cpp:511
QList< Mapping > m_args
Definition: template.cpp:3775
A container to store a key-value pair.
Definition: template.cpp:501
std::vector< size_t > Mapping(std::vector< geo::AuxDetGeo * > &adgeo)
void addIndexEntry(const QCString &indexName, const QValueList< TemplateKeyValue > &arguments)
Definition: template.cpp:2507
void setLocation(const QCString &templateName, int line)
Definition: template.cpp:540

Member Data Documentation

QList<Mapping> TemplateNodeIndexEntry::m_args
private

Definition at line 3775 of file template.cpp.

QCString TemplateNodeIndexEntry::m_name
private

Definition at line 3774 of file template.cpp.


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