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

Private data of the template engine. More...

Classes

class  IncludeEntry
 

Public Member Functions

 Private (TemplateEngine *engine)
 
TemplateloadByName (const QCString &fileName, int line)
 
void unload (Template *)
 
void enterBlock (const QCString &fileName, const QCString &blockName, int line)
 
void leaveBlock ()
 
void printIncludeContext (const char *fileName, int line) const
 
void setOutputExtension (const char *extension)
 
QCString outputExtension () const
 

Private Attributes

QDict< Templatem_templateCache
 
TemplateEnginem_engine
 
QList< IncludeEntrym_includeStack
 
QCString m_extension
 

Detailed Description

Private data of the template engine.

Definition at line 4837 of file template.cpp.

Constructor & Destructor Documentation

TemplateEngine::Private::Private ( TemplateEngine engine)
inline

Definition at line 4857 of file template.cpp.

4857  : m_templateCache(17) /*, m_indent(0)*/, m_engine(engine)
4858  {
4859  m_templateCache.setAutoDelete(TRUE);
4860  m_includeStack.setAutoDelete(TRUE);
4861  }
QList< IncludeEntry > m_includeStack
Definition: template.cpp:4947
QDict< Template > m_templateCache
Definition: template.cpp:4944
TemplateEngine * m_engine
Definition: template.cpp:4946
const bool TRUE
Definition: qglobal.h:371

Member Function Documentation

void TemplateEngine::Private::enterBlock ( const QCString fileName,
const QCString blockName,
int  line 
)
inline

Definition at line 4893 of file template.cpp.

4894  {
4895  //for (int i=0;i<m_indent;i++) printf(" ");
4896  //m_indent++;
4897  //printf("enterBlock(%s,%s,%d) {\n",fileName.data(),blockName.data(),line);
4898  m_includeStack.append(new IncludeEntry(IncludeEntry::Block,fileName,blockName,line));
4899  }
QList< IncludeEntry > m_includeStack
Definition: template.cpp:4947
void line(double t, double *p, double &x, double &y, double &z)
void TemplateEngine::Private::leaveBlock ( )
inline

Definition at line 4901 of file template.cpp.

4902  {
4903  //m_indent--;
4904  //for (int i=0;i<m_indent;i++) printf(" ");
4905  //printf("}\n");
4906  m_includeStack.removeLast();
4907  }
QList< IncludeEntry > m_includeStack
Definition: template.cpp:4947
Template* TemplateEngine::Private::loadByName ( const QCString fileName,
int  line 
)
inline

Definition at line 4862 of file template.cpp.

4863  {
4864  //for (int i=0;i<m_indent;i++) printf(" ");
4865  //m_indent++;
4866  //printf("loadByName(%s,%d) {\n",fileName.data(),line);
4867  m_includeStack.append(new IncludeEntry(IncludeEntry::Template,fileName,QCString(),line));
4868  Template *templ = m_templateCache.find(fileName);
4869  if (templ==0)
4870  {
4871  const QCString data = ResourceMgr::instance().getAsString(fileName);
4872  if (!data.isEmpty())
4873  {
4874  templ = new TemplateImpl(m_engine,fileName,data,m_extension);
4875  m_templateCache.insert(fileName,templ);
4876  }
4877  else
4878  {
4879  err("Cound not open template file %s\n",fileName.data());
4880  }
4881  }
4882  return templ;
4883  }
QList< IncludeEntry > m_includeStack
Definition: template.cpp:4947
QCString getAsString(const char *name) const
Abstract interface for a template.
Definition: template.h:542
bool isEmpty() const
Definition: qcstring.h:189
Internal class representing the implementation of a template.
Definition: template.cpp:2262
static ResourceMgr & instance()
Definition: resourcemgr.cpp:35
QDict< Template > m_templateCache
Definition: template.cpp:4944
TemplateEngine * m_engine
Definition: template.cpp:4946
const char * data() const
Definition: qcstring.h:207
void err(const char *fmt,...)
Definition: message.cpp:226
void line(double t, double *p, double &x, double &y, double &z)
QCString TemplateEngine::Private::outputExtension ( ) const
inline

Definition at line 4938 of file template.cpp.

4939  {
4940  return m_extension;
4941  }
void TemplateEngine::Private::printIncludeContext ( const char *  fileName,
int  line 
) const
inline

Definition at line 4909 of file template.cpp.

4910  {
4912  li.toLast();
4913  IncludeEntry *ie=li.current();
4914  while ((ie=li.current()))
4915  {
4916  --li;
4917  IncludeEntry *next=li.current();
4918  if (ie->type()==IncludeEntry::Template)
4919  {
4920  if (next)
4921  {
4922  warn(fileName,line," inside template '%s' included from template '%s' at line %d",ie->fileName().data(),next->fileName().data(),ie->line());
4923  }
4924  }
4925  else // ie->type()==IncludeEntry::Block
4926  {
4927  warn(fileName,line," included by block '%s' inside template '%s' at line %d",ie->blockName().data(),
4928  ie->fileName().data(),ie->line());
4929  }
4930  }
4931  }
QList< IncludeEntry > m_includeStack
Definition: template.cpp:4947
fileName
Definition: dumpTree.py:9
void warn(const char *file, int line, const char *fmt,...)
Definition: message.cpp:183
void line(double t, double *p, double &x, double &y, double &z)
void TemplateEngine::Private::setOutputExtension ( const char *  extension)
inline

Definition at line 4933 of file template.cpp.

4934  {
4935  m_extension = extension;
4936  }
void TemplateEngine::Private::unload ( Template )
inline

Definition at line 4884 of file template.cpp.

4885  {
4886  //(void)t;
4887  //m_indent--;
4888  //for (int i=0;i<m_indent;i++) printf(" ");
4889  //printf("}\n");
4890  m_includeStack.removeLast();
4891  }
QList< IncludeEntry > m_includeStack
Definition: template.cpp:4947

Member Data Documentation

TemplateEngine* TemplateEngine::Private::m_engine
private

Definition at line 4946 of file template.cpp.

QCString TemplateEngine::Private::m_extension
private

Definition at line 4948 of file template.cpp.

QList<IncludeEntry> TemplateEngine::Private::m_includeStack
private

Definition at line 4947 of file template.cpp.

QDict<Template> TemplateEngine::Private::m_templateCache
private

Definition at line 4944 of file template.cpp.


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