Classes | Public Member Functions | Private Attributes | List of all members
TemplateNodeSet Class Reference

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

Inheritance diagram for TemplateNodeSet:
TemplateNodeCreator< TemplateNodeSet > TemplateNode

Classes

struct  Mapping
 

Public Member Functions

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

Private Attributes

Mappingm_mapping
 

Additional Inherited Members

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

Detailed Description

Class representing an 'set' tag in a template.

Definition at line 3984 of file template.cpp.

Constructor & Destructor Documentation

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

Definition at line 3994 of file template.cpp.

3996  {
3997  TRACE(("{TemplateNodeSet(%s)\n",data.data()));
3998  ExpressionParser expParser(parser,line);
3999  // data format: name=expression
4000  int j=data.find('=');
4001  ExprAst *expr = 0;
4002  if (j>0 && (expr = expParser.parse(data.mid(j+1))))
4003  {
4004  m_mapping = new Mapping(data.left(j),expr);
4005  }
4006  TRACE(("}TemplateNodeSet(%s)\n",data.data()));
4007  }
QCString left(uint len) const
Definition: qcstring.cpp:213
int find(char c, int index=0, bool cs=TRUE) const
Definition: qcstring.cpp:41
TemplateNode * parent()
Definition: template.cpp:1647
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)
Mapping * m_mapping
Definition: template.cpp:4024
Recursive decent parser for Django style template expressions.
Definition: template.cpp:1680
#define TRACE(x)
Definition: template.cpp:43
TemplateNodeSet::~TemplateNodeSet ( )
inline

Definition at line 4008 of file template.cpp.

4009  {
4010  delete m_mapping;
4011  }
Mapping * m_mapping
Definition: template.cpp:4024

Member Function Documentation

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

Implements TemplateNode.

Definition at line 4012 of file template.cpp.

4013  {
4014  TemplateContextImpl *ci = dynamic_cast<TemplateContextImpl*>(c);
4015  if (ci==0) return; // should not happen
4017  if (m_mapping)
4018  {
4020  ci->set(m_mapping->name,value);
4021  }
4022  }
Internal class representing the implementation of a template context.
Definition: template.cpp:511
void set(const char *name, const TemplateVariant &v)
Definition: template.cpp:2315
virtual TemplateVariant resolve(TemplateContext *)
Definition: template.cpp:1368
Variant type which can hold one value of a fixed set of types.
Definition: template.h:90
Mapping * m_mapping
Definition: template.cpp:4024
void setLocation(const QCString &templateName, int line)
Definition: template.cpp:540

Member Data Documentation

Mapping* TemplateNodeSet::m_mapping
private

Definition at line 4024 of file template.cpp.


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