summaryrefslogtreecommitdiffstats
path: root/tools/qdoc3/codeparser.cpp
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2011-02-02 06:43:48 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2011-02-02 06:43:48 (GMT)
commit8fa689ed67583491cbfd5b8cc58860c15ec4903c (patch)
tree91585437344a5c668c860cb8432e364e3c3563bb /tools/qdoc3/codeparser.cpp
parent95b17fbe91eb3b1b0fcac92d8a8934769e4cd847 (diff)
parent1e7ab0e849900bacf71935f2a2150116b8dc17d1 (diff)
downloadQt-8fa689ed67583491cbfd5b8cc58860c15ec4903c.zip
Qt-8fa689ed67583491cbfd5b8cc58860c15ec4903c.tar.gz
Qt-8fa689ed67583491cbfd5b8cc58860c15ec4903c.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-doc-staging into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/qt-doc-staging: (208 commits) Replace all occurances of "Qt 4.7" with "QtQuick 1.0" Doc: Adjusted the font sizes for the offline documentation. Doc: Added a missing style sheet to the qhp manifest. Doc: Fixed the qthelp namespace for the Qt documentation. Doc: including missing pages in overviews. Doc: Fixed typo in QCoreApplication docs Fixed whitespace. Avoid hard-coding product names in page titles. Doc: Unindented a code snippet. Doc: Fixed confusing wording of a sentence. Doc: Fixed a broken link. Doc: Updated the information about commercial editions of Qt. Doc: Fixed qdoc warnings about broken links. Doc: Added preprocessor coloring. Doc: Added a link from the plugin guide to the plugin deployment guide. Doc: Fixed the syntax of QML code snippets. doc: Fixed a missing * in the docs for QML_DECLARE_TYPE Doc: Fixed missing images in qt demo Doc: Fixing typo Doc: fixing bugs and typos based on feedback ...
Diffstat (limited to 'tools/qdoc3/codeparser.cpp')
-rw-r--r--tools/qdoc3/codeparser.cpp41
1 files changed, 38 insertions, 3 deletions
diff --git a/tools/qdoc3/codeparser.cpp b/tools/qdoc3/codeparser.cpp
index 0ecf7db..cf91b75 100644
--- a/tools/qdoc3/codeparser.cpp
+++ b/tools/qdoc3/codeparser.cpp
@@ -47,7 +47,6 @@
#include "node.h"
#include "tree.h"
#include "config.h"
-#include <QDebug>
QT_BEGIN_NAMESPACE
@@ -99,14 +98,14 @@ void CodeParser::initializeParser(const Config& config)
}
/*!
- Teerminating a code parser is trivial.
+ Terminating a code parser is trivial.
*/
void CodeParser::terminateParser()
{
// nothing.
}
-QString CodeParser::headerFileNameFilter()
+QStringList CodeParser::headerFileNameFilter()
{
return sourceFileNameFilter();
}
@@ -159,6 +158,42 @@ CodeParser *CodeParser::parserForLanguage(const QString& language)
return 0;
}
+CodeParser *CodeParser::parserForHeaderFile(const QString &filePath)
+{
+ QString fileName = QFileInfo(filePath).fileName();
+
+ QList<CodeParser *>::ConstIterator p = parsers.begin();
+ while (p != parsers.end()) {
+
+ QStringList headerPatterns = (*p)->headerFileNameFilter();
+ foreach (QString pattern, headerPatterns) {
+ QRegExp re(pattern, Qt::CaseInsensitive, QRegExp::Wildcard);
+ if (re.exactMatch(fileName))
+ return *p;
+ }
+ ++p;
+ }
+ return 0;
+}
+
+CodeParser *CodeParser::parserForSourceFile(const QString &filePath)
+{
+ QString fileName = QFileInfo(filePath).fileName();
+
+ QList<CodeParser *>::ConstIterator p = parsers.begin();
+ while (p != parsers.end()) {
+
+ QStringList sourcePatterns = (*p)->sourceFileNameFilter();
+ foreach (QString pattern, sourcePatterns) {
+ QRegExp re(pattern, Qt::CaseInsensitive, QRegExp::Wildcard);
+ if (re.exactMatch(fileName))
+ return *p;
+ }
+ ++p;
+ }
+ return 0;
+}
+
/*!
Returns the set of strings representing the common metacommands.
*/