summaryrefslogtreecommitdiffstats
path: root/src/dirdef.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/dirdef.cpp')
-rw-r--r--src/dirdef.cpp27
1 files changed, 25 insertions, 2 deletions
diff --git a/src/dirdef.cpp b/src/dirdef.cpp
index 2ca264f..0e9a898 100644
--- a/src/dirdef.cpp
+++ b/src/dirdef.cpp
@@ -66,10 +66,33 @@ void DirDef::addFile(FileDef *fd)
fd->setDirDef(this);
}
+static QCString escapeDirName(const QCString &anchor)
+{
+ QCString result;
+ int l = anchor.length(),i;
+ for (i=0;i<l;i++)
+ {
+ char c = anchor.at(i);
+ if ((c>='a' && c<='z') || (c>='A' && c<='Z') || (c>='0' && c<='9'))
+ {
+ result+=c;
+ }
+ else
+ {
+ static char hexStr[]="0123456789ABCDEF";
+ char escChar[]={ '_', 0, 0, 0 };
+ escChar[1]=hexStr[c>>4];
+ escChar[2]=hexStr[c&0xf];
+ result+=escChar;
+ }
+ }
+ return result;
+}
+
QCString DirDef::getOutputFileBase() const
{
- //return "dir_"+convertNameToFile(name());
- return QCString().sprintf("dir_%06d",m_dirCount);
+ return "dir_"+escapeDirName(name());
+ //return QCString().sprintf("dir_%06d",m_dirCount);
}
void DirDef::writeDetailedDocumentation(OutputList &ol)