Skip to content

Commit f41a679

Browse files
committed
issue #9236 doxygen x_noenv should always diff system-dependent settings
Making the `CASE_SENSE_NAMES` settings an enum with values `SYSTEM`, `YES` and `NO`. In case `SYSTEM` is chosen the value is, system dependently changed at runtime.
1 parent 94fa0c1 commit f41a679

File tree

4 files changed

+20
-6
lines changed

4 files changed

+20
-6
lines changed

src/config.xml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -995,7 +995,7 @@ Go to the <a href="commands.html">next</a> section or return to the
995995
]]>
996996
</docs>
997997
</option>
998-
<option type='bool' id='CASE_SENSE_NAMES' defval='0' altdefval='Portable::fileSystemIsCaseSensitive()'>
998+
<option type='enum' id='CASE_SENSE_NAMES' defval='SYSTEM'>
999999
<docs>
10001000
<![CDATA[
10011001
With the correct setting of option \c CASE_SENSE_NAMES doxygen will better be able to match the
@@ -1014,6 +1014,9 @@ Go to the <a href="commands.html">next</a> section or return to the
10141014
whereas on Linux or other Unix flavors it should typically be set to \c YES.
10151015
]]>
10161016
</docs>
1017+
<value name="SYSTEM" />
1018+
<value name="NO"/>
1019+
<value name="YES" />
10171020
</option>
10181021
<option type='bool' id='HIDE_SCOPE_NAMES' defval='0'>
10191022
<docs>

src/filename.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
#include <vector>
2121

2222
#include "linkedmap.h"
23-
#include "config.h"
2423
#include "utf8.h"
24+
#include "util.h"
2525

2626
class FileDef;
2727

@@ -59,7 +59,7 @@ class FileNameFn
5959
std::string searchKey(std::string input) const
6060
{
6161
std::string key = input;
62-
if (!Config_getBool(CASE_SENSE_NAMES))
62+
if (!getCaseSenseNames())
6363
{
6464
key = convertUTF8ToLower(key);
6565
}

src/util.cpp

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3594,11 +3594,20 @@ int getUtf8Char(const char *input,char ids[MAX_UTF8_CHAR_SIZE],CaseModifier modi
35943594
}
35953595
#endif
35963596

3597+
bool getCaseSenseNames()
3598+
{
3599+
auto caseSenseNames = Config_getEnum(CASE_SENSE_NAMES);
3600+
3601+
if (caseSenseNames == CASE_SENSE_NAMES_t::YES) return true;
3602+
else if (caseSenseNames == CASE_SENSE_NAMES_t::NO) return false;
3603+
else return Portable::fileSystemIsCaseSensitive();
3604+
}
3605+
35973606
// note that this function is not reentrant due to the use of static growBuf!
35983607
QCString escapeCharsInString(const QCString &name,bool allowDots,bool allowUnderscore)
35993608
{
36003609
if (name.isEmpty()) return name;
3601-
bool caseSenseNames = Config_getBool(CASE_SENSE_NAMES);
3610+
bool caseSenseNames = getCaseSenseNames();
36023611
bool allowUnicodeNames = Config_getBool(ALLOW_UNICODE_NAMES);
36033612
GrowBuf growBuf;
36043613
signed char c;
@@ -3680,7 +3689,7 @@ QCString escapeCharsInString(const QCString &name,bool allowDots,bool allowUnder
36803689
QCString unescapeCharsInString(const QCString &s)
36813690
{
36823691
if (s.isEmpty()) return s;
3683-
bool caseSenseNames = Config_getBool(CASE_SENSE_NAMES);
3692+
bool caseSenseNames = getCaseSenseNames();
36843693
QCString result;
36853694
const char *p = s.data();
36863695
if (p)
@@ -6457,7 +6466,7 @@ QCString filterTitle(const QCString &title)
64576466

64586467
bool patternMatch(const FileInfo &fi,const StringVector &patList)
64596468
{
6460-
bool caseSenseNames = Config_getBool(CASE_SENSE_NAMES);
6469+
bool caseSenseNames = getCaseSenseNames();
64616470
bool found = FALSE;
64626471

64636472
// For platforms where the file system is non case sensitive overrule the setting

src/util.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,8 @@ PageDef *addRelatedPage(const QCString &name,
283283
SrcLangExt lang=SrcLangExt_Unknown
284284
);
285285

286+
bool getCaseSenseNames();
287+
286288
QCString escapeCharsInString(const QCString &name,bool allowDots,bool allowUnderscore=FALSE);
287289
QCString unescapeCharsInString(const QCString &s);
288290

0 commit comments

Comments
 (0)