diff options
Diffstat (limited to 'tools/qdoc3/config.cpp')
-rw-r--r-- | tools/qdoc3/config.cpp | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/tools/qdoc3/config.cpp b/tools/qdoc3/config.cpp index 08a8187..838f6ac 100644 --- a/tools/qdoc3/config.cpp +++ b/tools/qdoc3/config.cpp @@ -329,13 +329,16 @@ QList<QRegExp> Config::getRegExpList(const QString& var) const } /*! - This function is slower than it could be. + This function is slower than it could be. What it does is + find all the keys that begin with \a var + dot and return + the matching keys in a set, stripped of the matching prefix + and dot. */ QSet<QString> Config::subVars(const QString& var) const { QSet<QString> result; QString varDot = var + QLatin1Char('.'); - QMap<QString, QString>::ConstIterator v = stringValueMap.begin(); + QStringMultiMap::ConstIterator v = stringValueMap.begin(); while (v != stringValueMap.end()) { if (v.key().startsWith(varDot)) { QString subVar = v.key().mid(varDot.length()); @@ -350,6 +353,27 @@ QSet<QString> Config::subVars(const QString& var) const } /*! + Same as subVars(), but in this case we return a string map + with the matching keys (stripped of the prefix \a var and + mapped to their values. The pairs are inserted into \a t + */ +void Config::subVarsAndValues(const QString& var, QStringMultiMap& t) const +{ + QString varDot = var + QLatin1Char('.'); + QStringMultiMap::ConstIterator v = stringValueMap.begin(); + while (v != stringValueMap.end()) { + if (v.key().startsWith(varDot)) { + QString subVar = v.key().mid(varDot.length()); + int dot = subVar.indexOf(QLatin1Char('.')); + if (dot != -1) + subVar.truncate(dot); + t.insert(subVar,v.value()); + } + ++v; + } +} + +/*! Builds and returns a list of file pathnames for the file type specified by \a filesVar (e.g. "headers" or "sources"). The files are found in the directories specified by |