My Project
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 2802 of file template.cpp.

Constructor & Destructor Documentation

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

Definition at line 2805 of file template.cpp.

: TemplateNode(parent), m_templateName(parser->templateName()), m_line(line) {}

Member Function Documentation

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

Definition at line 2807 of file template.cpp.

{
return new T(parser,parent,line,data);
}
template<class T>
TemplateImpl* TemplateNodeCreator< T >::getTemplate ( )
inline

Definition at line 2814 of file template.cpp.

{
TemplateNode *root = this;
while (root && root->parent())
{
root = root->parent();
}
return dynamic_cast<TemplateImpl*>(root);
}
template<class T>
void TemplateNodeCreator< T >::mkpath ( TemplateContextImpl ci,
const QCString &  fileName 
)
inlineprotected

Definition at line 2824 of file template.cpp.

{
int i=fileName.find('/');
QCString outputDir = ci->outputDirectory();
QDir d(outputDir);
if (!d.exists())
{
QDir rootDir;
rootDir.setPath(QDir::currentDirPath());
if (!rootDir.mkdir(outputDir))
{
err("tag OUTPUT_DIRECTORY: Output directory `%s' does not "
"exist and cannot be created\n",outputDir.data());
return;
}
d.setPath(outputDir);
}
int j=0;
while (i!=-1) // fileName contains path part
{
if (d.exists())
{
bool ok = d.mkdir(fileName.mid(j,i-j));
if (!ok) break;
QCString dirName = outputDir+'/'+fileName.left(i);
d = QDir(dirName);
j = i+1;
}
i=fileName.find('/',i+1);
}
}

Member Data Documentation

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

Definition at line 2856 of file template.cpp.

Referenced by TemplateNodeBlock::render().

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

Definition at line 2855 of file template.cpp.

Referenced by TemplateNodeBlock::render().


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