diff options
author | Dimitri van Heesch <dimitri@stack.nl> | 2005-10-10 19:22:31 (GMT) |
---|---|---|
committer | Dimitri van Heesch <dimitri@stack.nl> | 2005-10-10 19:22:31 (GMT) |
commit | c9ed38abcef60f4ecb9fc08a1ddd936762d5342c (patch) | |
tree | 30215767ee72661b15eae6b66e51b409feff64cf /src/dirdef.cpp | |
parent | c1cf420f89fe57c162372b66bca70ff2e055f48f (diff) | |
download | Doxygen-c9ed38abcef60f4ecb9fc08a1ddd936762d5342c.zip Doxygen-c9ed38abcef60f4ecb9fc08a1ddd936762d5342c.tar.gz Doxygen-c9ed38abcef60f4ecb9fc08a1ddd936762d5342c.tar.bz2 |
Release-1.4.5-20051010
Diffstat (limited to 'src/dirdef.cpp')
-rw-r--r-- | src/dirdef.cpp | 52 |
1 files changed, 32 insertions, 20 deletions
diff --git a/src/dirdef.cpp b/src/dirdef.cpp index 0e9a898..8452f0b 100644 --- a/src/dirdef.cpp +++ b/src/dirdef.cpp @@ -1,3 +1,5 @@ +#include <md5.h> + #include "dirdef.h" #include "filename.h" #include "doxygen.h" @@ -66,32 +68,42 @@ void DirDef::addFile(FileDef *fd) fd->setDirDef(this); } -static QCString escapeDirName(const QCString &anchor) +static QCString encodeDirName(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; + + // convert to md5 hash + uchar md5_sig[16]; + QCString sigStr(33); + MD5Buffer((const unsigned char *)anchor.data(),anchor.length(),md5_sig); + MD5SigToString(md5_sig,sigStr.data(),33); + return sigStr; + + // old algorithm + +// 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_"+escapeDirName(name()); + return "dir_"+encodeDirName(name()); //return QCString().sprintf("dir_%06d",m_dirCount); } |