summaryrefslogtreecommitdiffstats
path: root/src/util.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/util.cpp')
-rwxr-xr-xsrc/util.cpp115
1 files changed, 49 insertions, 66 deletions
diff --git a/src/util.cpp b/src/util.cpp
index 6f3bc40..f089858 100755
--- a/src/util.cpp
+++ b/src/util.cpp
@@ -250,8 +250,8 @@ void writePageRef(OutputDocInterface &od,const char *cn,const char *mn)
od.disable(OutputGenerator::Html);
od.disable(OutputGenerator::Man);
- if (Config_getBool("PDF_HYPERLINKS")) od.disable(OutputGenerator::Latex);
- if (Config_getBool("RTF_HYPERLINKS")) od.disable(OutputGenerator::RTF);
+ if (Config_getBool(PDF_HYPERLINKS)) od.disable(OutputGenerator::Latex);
+ if (Config_getBool(RTF_HYPERLINKS)) od.disable(OutputGenerator::RTF);
od.startPageRef();
od.docify(theTranslator->trPageAbbreviation());
od.endPageRef(cn,mn);
@@ -293,19 +293,19 @@ static QCString stripFromPath(const QCString &path,QStrList &l)
}
/*! strip part of \a path if it matches
- * one of the paths in the Config_getList("STRIP_FROM_PATH") list
+ * one of the paths in the Config_getList(STRIP_FROM_PATH) list
*/
QCString stripFromPath(const QCString &path)
{
- return stripFromPath(path,Config_getList("STRIP_FROM_PATH"));
+ return stripFromPath(path,Config_getList(STRIP_FROM_PATH));
}
/*! strip part of \a path if it matches
- * one of the paths in the Config_getList("INCLUDE_PATH") list
+ * one of the paths in the Config_getList(INCLUDE_PATH) list
*/
QCString stripFromIncludePath(const QCString &path)
{
- return stripFromPath(path,Config_getList("STRIP_FROM_INC_PATH"));
+ return stripFromPath(path,Config_getList(STRIP_FROM_INC_PATH));
}
/*! try to determine if \a name is a source or a header file name by looking
@@ -1570,7 +1570,7 @@ ClassDef *getResolvedClass(Definition *scope,
QCString *pResolvedType
)
{
- static bool optimizeOutputVhdl = Config_getBool("OPTIMIZE_OUTPUT_VHDL");
+ static bool optimizeOutputVhdl = Config_getBool(OPTIMIZE_OUTPUT_VHDL);
g_resolvedTypedefs.clear();
if (scope==0 ||
(scope->definitionType()!=Definition::TypeClass &&
@@ -1654,8 +1654,8 @@ static const char virtualScope[] = { 'v', 'i', 'r', 't', 'u', 'a', 'l', ':' };
// Note: this function is not reentrant due to the use of static buffer!
QCString removeRedundantWhiteSpace(const QCString &s)
{
- static bool cliSupport = Config_getBool("CPP_CLI_SUPPORT");
- static bool vhdl = Config_getBool("OPTIMIZE_OUTPUT_VHDL");
+ static bool cliSupport = Config_getBool(CPP_CLI_SUPPORT);
+ static bool vhdl = Config_getBool(OPTIMIZE_OUTPUT_VHDL);
if (s.isEmpty() || vhdl) return s;
static GrowBuf growBuf;
@@ -2347,8 +2347,8 @@ QCString getFileFilter(const char* name,bool isSourceCode)
// sanity check
if (name==0) return "";
- QStrList& filterSrcList = Config_getList("FILTER_SOURCE_PATTERNS");
- QStrList& filterList = Config_getList("FILTER_PATTERNS");
+ QStrList& filterSrcList = Config_getList(FILTER_SOURCE_PATTERNS);
+ QStrList& filterList = Config_getList(FILTER_PATTERNS);
QCString filterName;
bool found=FALSE;
@@ -2362,7 +2362,7 @@ QCString getFileFilter(const char* name,bool isSourceCode)
}
if (!found)
{ // then use the generic input filter
- return Config_getString("INPUT_FILTER");
+ return Config_getString(INPUT_FILTER);
}
else
{
@@ -2374,7 +2374,7 @@ QCString getFileFilter(const char* name,bool isSourceCode)
QCString transcodeCharacterStringToUTF8(const QCString &input)
{
bool error=FALSE;
- static QCString inputEncoding = Config_getString("INPUT_ENCODING");
+ static QCString inputEncoding = Config_getString(INPUT_ENCODING);
const char *outputEncoding = "UTF-8";
if (inputEncoding.isEmpty() || qstricmp(inputEncoding,outputEncoding)==0) return input;
int inputSize=input.length();
@@ -4658,7 +4658,7 @@ bool resolveRef(/* in */ const char *scName,
QCString linkToText(SrcLangExt lang,const char *link,bool isFileName)
{
- //static bool optimizeOutputJava = Config_getBool("OPTIMIZE_OUTPUT_JAVA");
+ //static bool optimizeOutputJava = Config_getBool(OPTIMIZE_OUTPUT_JAVA);
QCString result=link;
if (!result.isEmpty())
{
@@ -5131,20 +5131,20 @@ QCString substituteKeywords(const QCString &s,const char *title,
result = substitute(result,"$projectname",projName);
result = substitute(result,"$projectnumber",projNum);
result = substitute(result,"$projectbrief",projBrief);
- result = substitute(result,"$projectlogo",stripPath(Config_getString("PROJECT_LOGO")));
+ result = substitute(result,"$projectlogo",stripPath(Config_getString(PROJECT_LOGO)));
return result;
}
//----------------------------------------------------------------------
/*! Returns the character index within \a name of the first prefix
- * in Config_getList("IGNORE_PREFIX") that matches \a name at the left hand side,
+ * in Config_getList(IGNORE_PREFIX) that matches \a name at the left hand side,
* or zero if no match was found
*/
int getPrefixIndex(const QCString &name)
{
if (name.isEmpty()) return 0;
- static QStrList &sl = Config_getList("IGNORE_PREFIX");
+ static QStrList &sl = Config_getList(IGNORE_PREFIX);
char *s = sl.first();
while (s)
{
@@ -5241,8 +5241,8 @@ bool hasVisibleRoot(BaseClassList *bcl)
// note that this function is not reentrant due to the use of static growBuf!
QCString escapeCharsInString(const char *name,bool allowDots,bool allowUnderscore)
{
- static bool caseSenseNames = Config_getBool("CASE_SENSE_NAMES");
- static bool allowUnicodeNames = Config_getBool("ALLOW_UNICODE_NAMES");
+ static bool caseSenseNames = Config_getBool(CASE_SENSE_NAMES);
+ static bool allowUnicodeNames = Config_getBool(ALLOW_UNICODE_NAMES);
static GrowBuf growBuf;
growBuf.clear();
char c;
@@ -5353,8 +5353,8 @@ QCString escapeCharsInString(const char *name,bool allowDots,bool allowUnderscor
*/
QCString convertNameToFile(const char *name,bool allowDots,bool allowUnderscore)
{
- static bool shortNames = Config_getBool("SHORT_NAMES");
- static bool createSubdirs = Config_getBool("CREATE_SUBDIRS");
+ static bool shortNames = Config_getBool(SHORT_NAMES);
+ static bool createSubdirs = Config_getBool(CREATE_SUBDIRS);
QCString result;
if (shortNames) // use short names only
{
@@ -5436,7 +5436,7 @@ QCString convertNameToFile(const char *name,bool allowDots,bool allowUnderscore)
QCString relativePathToRoot(const char *name)
{
QCString result;
- if (Config_getBool("CREATE_SUBDIRS"))
+ if (Config_getBool(CREATE_SUBDIRS))
{
if (name==0)
{
@@ -5457,7 +5457,7 @@ QCString relativePathToRoot(const char *name)
void createSubDirs(QDir &d)
{
- if (Config_getBool("CREATE_SUBDIRS"))
+ if (Config_getBool(CREATE_SUBDIRS))
{
// create 4096 subdirectories
int l1,l2;
@@ -6469,10 +6469,10 @@ void addRefItem(const QList<ListItemInfo> *sli,
&&
(
// either not a built-in list or the list is enabled
- (lii->type!="todo" || Config_getBool("GENERATE_TODOLIST")) &&
- (lii->type!="test" || Config_getBool("GENERATE_TESTLIST")) &&
- (lii->type!="bug" || Config_getBool("GENERATE_BUGLIST")) &&
- (lii->type!="deprecated" || Config_getBool("GENERATE_DEPRECATEDLIST"))
+ (lii->type!="todo" || Config_getBool(GENERATE_TODOLIST)) &&
+ (lii->type!="test" || Config_getBool(GENERATE_TESTLIST)) &&
+ (lii->type!="bug" || Config_getBool(GENERATE_BUGLIST)) &&
+ (lii->type!="deprecated" || Config_getBool(GENERATE_DEPRECATEDLIST))
)
)
{
@@ -6607,13 +6607,13 @@ void filterLatexString(FTextStream &t,const char *str,
case '>': t << "$>$"; break;
case '|': t << "$\\vert$"; break;
case '~': t << "$\\sim$"; break;
- case '[': if (Config_getBool("PDF_HYPERLINKS") || insideItem)
+ case '[': if (Config_getBool(PDF_HYPERLINKS) || insideItem)
t << "\\mbox{[}";
else
t << "[";
break;
case ']': if (pc=='[') t << "$\\,$";
- if (Config_getBool("PDF_HYPERLINKS") || insideItem)
+ if (Config_getBool(PDF_HYPERLINKS) || insideItem)
t << "\\mbox{]}";
else
t << "]";
@@ -6913,7 +6913,7 @@ QCString stripLeadingAndTrailingEmptyLines(const QCString &s,int &docLine)
void stringToSearchIndex(const QCString &docBaseUrl,const QCString &title,
const QCString &str,bool priority,const QCString &anchor)
{
- static bool searchEngine = Config_getBool("SEARCHENGINE");
+ static bool searchEngine = Config_getBool(SEARCHENGINE);
if (searchEngine)
{
Doxygen::searchIndex->setCurrentDoc(title,docBaseUrl,anchor);
@@ -6932,6 +6932,8 @@ void stringToSearchIndex(const QCString &docBaseUrl,const QCString &title,
static QDict<int> g_extLookup;
+const QDict<int> &getExtensionLookup() { return g_extLookup; }
+
static struct Lang2ExtMap
{
const char *langName;
@@ -7743,7 +7745,7 @@ bool readInputFile(const char *fileName,BufStr &inBuf,bool filter,bool isSourceC
{
// do character transcoding if needed.
transcodeCharacterBuffer(fileName,inBuf,inBuf.curPos(),
- Config_getString("INPUT_ENCODING"),"UTF-8");
+ Config_getString(INPUT_ENCODING),"UTF-8");
}
//inBuf.addChar('\n'); /* to prevent problems under Windows ? */
@@ -7849,7 +7851,7 @@ void writeSummaryLink(OutputList &ol,const char *label,const char *title,
QCString externalLinkTarget()
{
- static bool extLinksInWindow = Config_getBool("EXT_LINKS_IN_WINDOW");
+ static bool extLinksInWindow = Config_getBool(EXT_LINKS_IN_WINDOW);
if (extLinksInWindow) return "target=\"_blank\" "; else return "";
}
@@ -7888,9 +7890,9 @@ QCString externalRef(const QCString &relPath,const QCString &ref,bool href)
*/
void writeColoredImgData(const char *dir,ColoredImgDataItem data[])
{
- static int hue = Config_getInt("HTML_COLORSTYLE_HUE");
- static int sat = Config_getInt("HTML_COLORSTYLE_SAT");
- static int gamma = Config_getInt("HTML_COLORSTYLE_GAMMA");
+ static int hue = Config_getInt(HTML_COLORSTYLE_HUE);
+ static int sat = Config_getInt(HTML_COLORSTYLE_SAT);
+ static int gamma = Config_getInt(HTML_COLORSTYLE_GAMMA);
while (data->name)
{
QCString fileName;
@@ -7923,9 +7925,9 @@ QCString replaceColorMarkers(const char *str)
if (s.isEmpty()) return result;
static QRegExp re("##[0-9A-Fa-f][0-9A-Fa-f]");
static const char hex[] = "0123456789ABCDEF";
- static int hue = Config_getInt("HTML_COLORSTYLE_HUE");
- static int sat = Config_getInt("HTML_COLORSTYLE_SAT");
- static int gamma = Config_getInt("HTML_COLORSTYLE_GAMMA");
+ static int hue = Config_getInt(HTML_COLORSTYLE_HUE);
+ static int sat = Config_getInt(HTML_COLORSTYLE_SAT);
+ static int gamma = Config_getInt(HTML_COLORSTYLE_GAMMA);
int i,l,sl=s.length(),p=0;
while ((i=re.match(s,p,&l))!=-1)
{
@@ -8097,8 +8099,8 @@ QCString correctURL(const QCString &url,const QCString &relPath)
bool protectionLevelVisible(Protection prot)
{
- static bool extractPrivate = Config_getBool("EXTRACT_PRIVATE");
- static bool extractPackage = Config_getBool("EXTRACT_PACKAGE");
+ static bool extractPrivate = Config_getBool(EXTRACT_PRIVATE);
+ static bool extractPackage = Config_getBool(EXTRACT_PACKAGE);
return (prot!=Private && prot!=Package) ||
(prot==Private && extractPrivate) ||
@@ -8118,7 +8120,7 @@ QCString stripIndentation(const QCString &s)
int indent=0;
int minIndent=1000000; // "infinite"
bool searchIndent=TRUE;
- static int tabSize=Config_getInt("TAB_SIZE");
+ static int tabSize=Config_getInt(TAB_SIZE);
while ((c=*p++))
{
if (c=='\t') indent+=tabSize - (indent%tabSize);
@@ -8176,7 +8178,7 @@ QCString stripIndentation(const QCString &s)
bool fileVisibleInIndex(FileDef *fd,bool &genSourceFile)
{
- static bool allExternals = Config_getBool("ALLEXTERNALS");
+ static bool allExternals = Config_getBool(ALLEXTERNALS);
bool isDocFile = fd->isDocumentationFile();
genSourceFile = !isDocFile && fd->generateSourceFile();
return ( ((allExternals && fd->isLinkable()) ||
@@ -8188,8 +8190,8 @@ bool fileVisibleInIndex(FileDef *fd,bool &genSourceFile)
void addDocCrossReference(MemberDef *src,MemberDef *dst)
{
- static bool referencedByRelation = Config_getBool("REFERENCED_BY_RELATION");
- static bool referencesRelation = Config_getBool("REFERENCES_RELATION");
+ static bool referencedByRelation = Config_getBool(REFERENCED_BY_RELATION);
+ static bool referencesRelation = Config_getBool(REFERENCES_RELATION);
//printf("--> addDocCrossReference src=%s,dst=%s\n",src->name().data(),dst->name().data());
if (dst->isTypedef() || dst->isEnumerate()) return; // don't add types
@@ -8333,7 +8335,7 @@ bool namespaceHasVisibleChild(NamespaceDef *nd,bool includeClasses)
bool classVisibleInIndex(ClassDef *cd)
{
- static bool allExternals = Config_getBool("ALLEXTERNALS");
+ static bool allExternals = Config_getBool(ALLEXTERNALS);
return (allExternals && cd->isLinkable()) || cd->isLinkableInProject();
}
@@ -8382,7 +8384,7 @@ void convertProtectionLevel(
int *outListType2
)
{
- static bool extractPrivate = Config_getBool("EXTRACT_PRIVATE");
+ static bool extractPrivate = Config_getBool(EXTRACT_PRIVATE);
// default representing 1-1 mapping
*outListType1=inListType;
*outListType2=-1;
@@ -8561,30 +8563,11 @@ bool mainPageHasTitle()
QCString getDotImageExtension(void)
{
- QCString imgExt = Config_getEnum("DOT_IMAGE_FORMAT");
+ QCString imgExt = Config_getEnum(DOT_IMAGE_FORMAT);
imgExt = imgExt.replace( QRegExp(":.*"), "" );
return imgExt;
}
-void initFilePattern(void)
-{
- // add default pattern if needed
- QStrList &filePatternList = Config_getList("FILE_PATTERNS");
- if (filePatternList.isEmpty())
- {
- QDictIterator<int> it( g_extLookup );
- QCString pattern;
- bool caseSens = portable_fileSystemIsCaseSensitive();
- for (;it.current();++it)
- {
- pattern = "*";
- pattern += it.currentKey();
- filePatternList.append(pattern.data());
- if (caseSens) filePatternList.append(pattern.upper().data());
- }
- }
-}
-
bool openOutputFile(const char *outFile,QFile &f)
{
bool fileOpened=FALSE;