Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
TemplateNodeCreator< T > Class Template Reference

Helper class for creating template AST tag nodes and returning the template for a given node. More...

Inheritance diagram for TemplateNodeCreator< T >:
TemplateNode

Public Member Functions

 TemplateNodeCreator (TemplateParser *parser, TemplateNode *parent, int line)
 
TemplateImplgetTemplate ()
 
- Public Member Functions inherited from TemplateNode
 TemplateNode (TemplateNode *parent)
 
virtual ~TemplateNode ()
 
virtual void render (FTextStream &ts, TemplateContext *c)=0
 
TemplateNodeparent ()
 

Static Public Member Functions

static TemplateNodecreateInstance (TemplateParser *parser, TemplateNode *parent, int line, const QCString &data)
 

Protected Member Functions

void mkpath (TemplateContextImpl *ci, const QCString &fileName)
 

Protected Attributes

QCString m_templateName
 
int m_line
 

Detailed Description

template<class T>
class TemplateNodeCreator< T >

Helper class for creating template AST tag nodes and returning the template for a given node.

Definition at line 2662 of file template.cpp.

Constructor & Destructor Documentation

template<class T>
TemplateNodeCreator< T >::TemplateNodeCreator ( TemplateParser parser,
TemplateNode parent,
int  line 
)
inline

Definition at line 2665 of file template.cpp.

2666  : TemplateNode(parent), m_templateName(parser->templateName()), m_line(line) {}
TemplateNode(TemplateNode *parent)
Definition: template.cpp:1642
QCString templateName() const
Definition: template.cpp:1668
void line(double t, double *p, double &x, double &y, double &z)
QCString m_templateName
Definition: template.cpp:2715

Member Function Documentation

template<class T>
static TemplateNode* TemplateNodeCreator< T >::createInstance ( TemplateParser parser,
TemplateNode parent,
int  line,
const QCString data 
)
inlinestatic

Definition at line 2667 of file template.cpp.

2671  {
2672  return new T(parser,parent,line,data);
2673  }
void line(double t, double *p, double &x, double &y, double &z)
template<class T>
TemplateImpl* TemplateNodeCreator< T >::getTemplate ( )
inline

Definition at line 2674 of file template.cpp.

2675  {
2676  TemplateNode *root = this;
2677  while (root && root->parent())
2678  {
2679  root = root->parent();
2680  }
2681  return dynamic_cast<TemplateImpl*>(root);
2682  }
Internal class representing the implementation of a template.
Definition: template.cpp:2262
TemplateNode * parent()
Definition: template.cpp:1647
Base class of all nodes in a template&#39;s AST.
Definition: template.cpp:1639
template<class T>
void TemplateNodeCreator< T >::mkpath ( TemplateContextImpl ci,
const QCString fileName 
)
inlineprotected

Definition at line 2684 of file template.cpp.

2685  {
2686  int i=fileName.find('/');
2687  QCString outputDir = ci->outputDirectory();
2688  QDir d(outputDir);
2689  if (!d.exists())
2690  {
2691  QDir rootDir;
2692  rootDir.setPath(QDir::currentDirPath());
2693  if (!rootDir.mkdir(outputDir))
2694  {
2695  err("tag OUTPUT_DIRECTORY: Output directory `%s' does not "
2696  "exist and cannot be created\n",outputDir.data());
2697  return;
2698  }
2699  d.setPath(outputDir);
2700  }
2701  int j=0;
2702  while (i!=-1) // fileName contains path part
2703  {
2704  if (d.exists())
2705  {
2706  bool ok = d.mkdir(fileName.mid(j,i-j));
2707  if (!ok) break;
2708  QCString dirName = outputDir+'/'+fileName.left(i);
2709  d = QDir(dirName);
2710  j = i+1;
2711  }
2712  i=fileName.find('/',i+1);
2713  }
2714  }
Traverses directory structures and contents in a platform-independent way.
Definition: qdir.h:52
QCString outputDirectory() const
Definition: template.cpp:544
virtual void setPath(const QString &path)
Definition: qdir.cpp:248
QCString left(uint len) const
Definition: qcstring.cpp:213
int find(char c, int index=0, bool cs=TRUE) const
Definition: qcstring.cpp:41
virtual bool mkdir(const QString &dirName, bool acceptAbsPath=TRUE) const
Definition: qdir_unix.cpp:98
static QString currentDirPath()
Definition: qdir_unix.cpp:141
const char * data() const
Definition: qcstring.h:207
void err(const char *fmt,...)
Definition: message.cpp:226
QCString mid(uint index, uint len=0xffffffff) const
Definition: qcstring.cpp:246

Member Data Documentation

template<class T>
int TemplateNodeCreator< T >::m_line
protected

Definition at line 2716 of file template.cpp.

template<class T>
QCString TemplateNodeCreator< T >::m_templateName
protected

Definition at line 2715 of file template.cpp.


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