summaryrefslogtreecommitdiffstats
path: root/src/template.cpp
diff options
context:
space:
mode:
authorDimitri van Heesch <dimitri@stack.nl>2014-07-27 08:28:51 (GMT)
committerDimitri van Heesch <dimitri@stack.nl>2014-08-02 12:36:46 (GMT)
commit9282aab5ed2a0cca3858df6e62132f959e99edb5 (patch)
tree33b950e4cd519cdc00f3eb5e887999b9eb7c4519 /src/template.cpp
parent7e3e890fedfb20e7018fadfa87ed97eef7f2b720 (diff)
downloadDoxygen-9282aab5ed2a0cca3858df6e62132f959e99edb5.zip
Doxygen-9282aab5ed2a0cca3858df6e62132f959e99edb5.tar.gz
Doxygen-9282aab5ed2a0cca3858df6e62132f959e99edb5.tar.bz2
Template context support for CREATE_SUBDIRS
Diffstat (limited to 'src/template.cpp')
-rw-r--r--src/template.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/template.cpp b/src/template.cpp
index 2f9f69c..ec8554b 100644
--- a/src/template.cpp
+++ b/src/template.cpp
@@ -27,6 +27,7 @@
#include <qfile.h>
#include <qregexp.h>
#include <qcstring.h>
+#include <qdir.h>
#include "sortdict.h"
#include "ftextstream.h"
@@ -3465,6 +3466,25 @@ class TemplateNodeCreate : public TemplateNodeCreator<TemplateNodeCreate>
delete m_templateExpr;
delete m_fileExpr;
}
+ void mkpath(TemplateContextImpl *ci,const QCString &fileName)
+ {
+ int i=fileName.find('/');
+ QCString outputDir = ci->outputDirectory();
+ QDir d(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);
+ }
+ }
void render(FTextStream &, TemplateContext *c)
{
TemplateContextImpl* ci = dynamic_cast<TemplateContextImpl*>(c);
@@ -3490,6 +3510,7 @@ class TemplateNodeCreate : public TemplateNodeCreator<TemplateNodeCreate>
TemplateImpl *createTemplate = ct ? dynamic_cast<TemplateImpl*>(ct) : 0;
if (createTemplate)
{
+ //mkpath(ci,outputFile);
QCString extension=outputFile;
int i=extension.findRev('.');
if (i!=-1)