diff options
Diffstat (limited to 'src/mangen.cpp')
-rw-r--r-- | src/mangen.cpp | 61 |
1 files changed, 27 insertions, 34 deletions
diff --git a/src/mangen.cpp b/src/mangen.cpp index ad3e63a..d4bd0aa 100644 --- a/src/mangen.cpp +++ b/src/mangen.cpp @@ -97,45 +97,38 @@ void ManGenerator::init() static QCString buildFileName(const char *name) { - QCString fileName=name; + QCString fileName; -#if 0 - // TODO: do something sensible here. - if (fileName.left(6)=="class_") + const char *p=name; + char c; + while ((c=*p++)) { - fileName=fileName.right(fileName.length()-6); - } - else if (fileName.left(10)=="interface_") - { - fileName=fileName.right(fileName.length()-10); - } - else if (fileName.left(7)=="struct_") - { - fileName=fileName.right(fileName.length()-7); - } - else if (fileName.left(6)=="union_") - { - fileName=fileName.right(fileName.length()-6); - } - else if (fileName.left(10)=="exception_") - { - fileName=fileName.right(fileName.length()-10); - } - else if (fileName.left(6)=="group_") - { - fileName=fileName.right(fileName.length()-6); - } - - int i; - if ((i=fileName.findRev('.'))!=-1) - { - fileName=fileName.left(i); + switch (c) + { + case ':': + fileName+="_"; + if (*p==':') p++; + break; + case '<': + case '>': + case '&': + case '*': + case '!': + case '^': + case '~': + case '%': + case '+': + fileName+="_"; + break; + default: + fileName+=c; + } } -#endif - if (convertToQCString(fileName.right(2))!=Config_getString("MAN_EXTENSION")) + QCString &manExtension = Config_getString("MAN_EXTENSION"); + if (convertToQCString(fileName.right(2))!=manExtension) { - fileName+=Config_getString("MAN_EXTENSION"); + fileName+=manExtension; } return fileName; |