summaryrefslogtreecommitdiffstats
path: root/src/doxygen.cpp
diff options
context:
space:
mode:
authordimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7>2008-11-03 10:58:01 (GMT)
committerdimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7>2008-11-03 10:58:01 (GMT)
commitb35a84b39214af8340a75ea086df299a2c3343e3 (patch)
tree22860540dd7f38d88a6b862c59b3f624a28f039f /src/doxygen.cpp
parentcd8d9d90f0ded716840cd405d88c8b711428e899 (diff)
downloadDoxygen-b35a84b39214af8340a75ea086df299a2c3343e3.zip
Doxygen-b35a84b39214af8340a75ea086df299a2c3343e3.tar.gz
Doxygen-b35a84b39214af8340a75ea086df299a2c3343e3.tar.bz2
Release-1.5.7.1-20081103
Diffstat (limited to 'src/doxygen.cpp')
-rw-r--r--src/doxygen.cpp68
1 files changed, 60 insertions, 8 deletions
diff --git a/src/doxygen.cpp b/src/doxygen.cpp
index ad82bbb..b919521 100644
--- a/src/doxygen.cpp
+++ b/src/doxygen.cpp
@@ -158,6 +158,7 @@ QCString spaces;
static bool g_successfulRun = FALSE;
static bool g_dumpSymbolMap = FALSE;
+static bool g_dumpConfigAsXML = FALSE;
@@ -8917,6 +8918,17 @@ static void dumpSymbolMap()
}
}
+//----------------------------------------------------------------------------
+
+void dumpConfigAsXML()
+{
+ QFile f("config.xml");
+ if (f.open(IO_WriteOnly))
+ {
+ QTextStream t(&f);
+ Config::instance()->writeXML(t);
+ }
+}
//----------------------------------------------------------------------------
// print the usage of doxygen
@@ -8977,15 +8989,15 @@ void initDoxygen()
Doxygen::runningTime.start();
initPreprocessor();
- ParserInterface *defaultParser = new CLanguageScanner;
- Doxygen::parserManager = new ParserManager(defaultParser);
- Doxygen::parserManager->registerParser(".py", new PythonLanguageScanner);
- Doxygen::parserManager->registerParser(".f", new FortranLanguageScanner);
- Doxygen::parserManager->registerParser(".f90", new FortranLanguageScanner);
- Doxygen::parserManager->registerParser(".vhd", new VHDLLanguageScanner);
+ Doxygen::parserManager = new ParserManager;
+ Doxygen::parserManager->registerParser("c", new CLanguageScanner, TRUE);
+ Doxygen::parserManager->registerParser("python", new PythonLanguageScanner);
+ Doxygen::parserManager->registerParser("fortran", new FortranLanguageScanner);
+ Doxygen::parserManager->registerParser("vhdl", new VHDLLanguageScanner);
// register any additional parsers here...
+ initDefaultExtensionMapping();
initClassMemberIndices();
initNamespaceMemberIndices();
initFileMemberIndices();
@@ -9245,6 +9257,9 @@ void readConfiguration(int argc, char **argv)
case 'm':
g_dumpSymbolMap = TRUE;
break;
+ case 'x':
+ g_dumpConfigAsXML = TRUE;
+ break;
case '-':
if (strcmp(&argv[optind][2],"help")==0)
{
@@ -9280,7 +9295,13 @@ void readConfiguration(int argc, char **argv)
if (genConfig)
{
+ checkConfiguration();
generateConfigFile(configName,shortList);
+ if (g_dumpConfigAsXML)
+ {
+ dumpConfigAsXML();
+ exit(0);
+ }
cleanUpDoxygen();
exit(0);
}
@@ -9461,6 +9482,37 @@ void parseInput()
atexit(exitDoxygen);
/**************************************************************************
+ * Add custom extension mappings
+ **************************************************************************/
+
+ QStrList &extMaps = Config_getList("EXTENSION_MAPPING");
+ char *mapping = extMaps.first();
+ while (mapping)
+ {
+ QCString mapStr = mapping;
+ int i;
+ if ((i=mapStr.find('='))!=-1)
+ {
+ QCString ext=mapStr.left(i).stripWhiteSpace().lower();
+ QCString language=mapStr.mid(i+1).stripWhiteSpace().lower();
+ if (!updateLanguageMapping(ext,language))
+ {
+ err("Failed to map file extension '%s' to unsupported language '%s'.\n"
+ "Check the EXTENSION_MAPPING setting in the config file.\n",
+ ext.data(),language.data());
+ }
+ else
+ {
+ msg("Adding custom extension mapping: .%s will be treated as language %s\n",
+ ext.data(),language.data());
+ }
+ }
+ mapping = extMaps.next();
+ }
+
+
+
+ /**************************************************************************
* Make sure the output directory exists
**************************************************************************/
QCString &outputDirectory = Config_getString("OUTPUT_DIRECTORY");
@@ -10031,8 +10083,8 @@ void generateOutput()
//}
if (g_dumpSymbolMap)
{
- dumpSymbolMap();
- exit(0);
+ dumpSymbolMap();
+ exit(0);
}
initDocParser();