diff options
author | dimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7> | 2001-12-29 18:30:48 (GMT) |
---|---|---|
committer | dimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7> | 2001-12-29 18:30:48 (GMT) |
commit | ff11b7d98ad7d24770afd151aa6b439adc7506d2 (patch) | |
tree | 048517043e4c90dcc686bc038b480825fe32886c /src/util.cpp | |
parent | 414d7b3bbfad8ec16237c3708af188ecaee62886 (diff) | |
download | Doxygen-ff11b7d98ad7d24770afd151aa6b439adc7506d2.zip Doxygen-ff11b7d98ad7d24770afd151aa6b439adc7506d2.tar.gz Doxygen-ff11b7d98ad7d24770afd151aa6b439adc7506d2.tar.bz2 |
Release-1.2.13
Diffstat (limited to 'src/util.cpp')
-rw-r--r-- | src/util.cpp | 79 |
1 files changed, 42 insertions, 37 deletions
diff --git a/src/util.cpp b/src/util.cpp index 4381c54..e73b45b 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -869,7 +869,7 @@ QCString tempArgListToString(ArgumentList *al) // compute the HTML anchors for a list of members -void setAnchors(char id,MemberList *ml,int groupId) +void setAnchors(ClassDef *cd,char id,MemberList *ml,int groupId) { int count=0; MemberListIterator mli(*ml); @@ -883,7 +883,8 @@ void setAnchors(char id,MemberList *ml,int groupId) anchor.sprintf("%c%d",id,count++); else anchor.sprintf("%c%d_%d",id,groupId,count++); - //printf("Member %s anchor %s\n",md->name(),anchor.data()); + if (cd) anchor.prepend(escapeCharsInString(cd->name(),FALSE)); + //printf("Member %s anchor %s\n",md->name().data(),anchor.data()); md->setAnchor(anchor); } } @@ -2878,6 +2879,44 @@ bool hasVisibleRoot(BaseClassList *bcl) //---------------------------------------------------------------------- +QCString escapeCharsInString(const char *name,bool allowDots) +{ + QCString result; + char c; + const char *p=name; + while ((c=*p++)!=0) + { + switch(c) + { + case '_': result+="__"; break; + case '-': result+="-"; break; + case ':': result+="_1"; break; + case '/': result+="_2"; break; + case '<': result+="_3"; break; + case '>': result+="_4"; break; + case '*': result+="_5"; break; + case '&': result+="_6"; break; + case '|': result+="_7"; break; + case '.': if (allowDots) result+="."; else result+="_8"; break; + case '!': result+="_9"; break; + case ',': result+="_00"; break; + case ' ': result+="_01"; break; + default: + if (Config_getBool("CASE_SENSE_NAMES") || !isupper(c)) + { + result+=c; + } + else + { + result+="_"; + result+=tolower(c); + } + break; + } + } + return result; +} + /*! This function determines the file name on disk of an item * given its name, which could be a class name with templete * arguments, so special characters need to be escaped. @@ -2906,41 +2945,7 @@ QCString convertNameToFile(const char *name,bool allowDots) } else // long names { - - QCString result; - char c; - const char *p=name; - while ((c=*p++)!=0) - { - switch(c) - { - case '_': result+="__"; break; - case '-': result+="-"; break; - case ':': result+="_1"; break; - case '/': result+="_2"; break; - case '<': result+="_3"; break; - case '>': result+="_4"; break; - case '*': result+="_5"; break; - case '&': result+="_6"; break; - case '|': result+="_7"; break; - case '.': if (allowDots) result+="."; else result+="_8"; break; - case '!': result+="_9"; break; - case ',': result+="_00"; break; - case ' ': result+="_01"; break; - default: - if (Config_getBool("CASE_SENSE_NAMES") || !isupper(c)) - { - result+=c; - } - else - { - result+="_"; - result+=tolower(c); - } - break; - } - } - return result; + return escapeCharsInString(name,allowDots); } } |