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

Engine to create templates and template contexts. More...

#include <template.h>

Classes

class  Private
 Private data of the template engine. More...
 

Public Member Functions

 TemplateEngine ()
 
 ~TemplateEngine ()
 
TemplateContextcreateContext () const
 
void destroyContext (TemplateContext *ctx)
 
TemplateloadByName (const QCString &fileName, int fromLine)
 
void unload (Template *t)
 
void printIncludeContext (const char *fileName, int line) const
 

Private Member Functions

void enterBlock (const QCString &fileName, const QCString &blockName, int line)
 
void leaveBlock ()
 
void setOutputExtension (const char *extension)
 
QCString outputExtension () const
 

Private Attributes

Privatep
 

Friends

class TemplateNodeBlock
 
class TemplateNodeCreate
 

Detailed Description

Engine to create templates and template contexts.

Definition at line 559 of file template.h.

Constructor & Destructor Documentation

TemplateEngine::TemplateEngine ( )

Create a template engine.

Definition at line 4951 of file template.cpp.

4952 {
4953  p = new Private(this);
4954 }
Definition: types.h:26
Private * p
Definition: template.h:608
TemplateEngine::~TemplateEngine ( )

Destroys the template engine.

Definition at line 4956 of file template.cpp.

4957 {
4958  delete p;
4959 }
Private * p
Definition: template.h:608

Member Function Documentation

TemplateContext * TemplateEngine::createContext ( ) const

Creates a new context that can be using to render a template.

See also
Template::render()

Definition at line 4961 of file template.cpp.

4962 {
4963  return new TemplateContextImpl(this);
4964 }
Internal class representing the implementation of a template context.
Definition: template.cpp:511
void TemplateEngine::destroyContext ( TemplateContext ctx)

Destroys a context created via createContext().

Parameters
[in]ctxThe context.

Definition at line 4966 of file template.cpp.

4967 {
4968  delete ctx;
4969 }
void TemplateEngine::enterBlock ( const QCString fileName,
const QCString blockName,
int  line 
)
private

Definition at line 4981 of file template.cpp.

4982 {
4983  p->enterBlock(fileName,blockName,line);
4984 }
void enterBlock(const QCString &fileName, const QCString &blockName, int line)
Definition: template.cpp:4893
Private * p
Definition: template.h:608
void line(double t, double *p, double &x, double &y, double &z)
void TemplateEngine::leaveBlock ( )
private

Definition at line 4986 of file template.cpp.

4987 {
4988  p->leaveBlock();
4989 }
Private * p
Definition: template.h:608
Template * TemplateEngine::loadByName ( const QCString fileName,
int  fromLine 
)

Creates a new template whose contents are in a file.

Parameters
[in]fileNameThe name of the file containing the template data
[in]fromLineThe line number of the statement that triggered the load
Returns
the new template, the engine will keep ownership of the object.

Definition at line 4971 of file template.cpp.

4972 {
4973  return p->loadByName(fileName,line);
4974 }
Private * p
Definition: template.h:608
void line(double t, double *p, double &x, double &y, double &z)
Template * loadByName(const QCString &fileName, int line)
Definition: template.cpp:4862
QCString TemplateEngine::outputExtension ( ) const
private

Returns the output extension, set via setOutputExtension()

Definition at line 5001 of file template.cpp.

5002 {
5003  return p->outputExtension();
5004 }
Private * p
Definition: template.h:608
QCString outputExtension() const
Definition: template.cpp:4938
void TemplateEngine::printIncludeContext ( const char *  fileName,
int  line 
) const

Prints the current template file include stack

Definition at line 4991 of file template.cpp.

4992 {
4994 }
void printIncludeContext(const char *fileName, int line) const
Definition: template.cpp:4909
fileName
Definition: dumpTree.py:9
Private * p
Definition: template.h:608
void line(double t, double *p, double &x, double &y, double &z)
void TemplateEngine::setOutputExtension ( const char *  extension)
private

Sets the extension of the output file. This is used to control the format of 'special' tags in the template

Definition at line 4996 of file template.cpp.

4997 {
4998  p->setOutputExtension(extension);
4999 }
Private * p
Definition: template.h:608
void setOutputExtension(const char *extension)
Definition: template.cpp:4933
void TemplateEngine::unload ( Template t)

Indicates that template t is no longer needed. The engine may decide to delete it.

Definition at line 4976 of file template.cpp.

4977 {
4978  p->unload(t);
4979 }
void unload(Template *)
Definition: template.cpp:4884
Private * p
Definition: template.h:608

Friends And Related Function Documentation

friend class TemplateNodeBlock
friend

Definition at line 594 of file template.h.

friend class TemplateNodeCreate
friend

Definition at line 595 of file template.h.

Member Data Documentation

Private* TemplateEngine::p
private

Definition at line 608 of file template.h.


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