diff options
author | Dimitri van Heesch <doxygen@gmail.com> | 2021-05-02 09:20:20 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-02 09:20:20 (GMT) |
commit | 4f4688844b3c6ff67782c2be95b2ceb195702067 (patch) | |
tree | 90cf8871d4cffc81ff99d392bc2b00191456de85 /src/docvisitor.cpp | |
parent | 4fd8254c903b251be91ab669f4d83cb86ebaf499 (diff) | |
parent | 4784ecea4d15c34af41c1adaa188159b124a1ed0 (diff) | |
download | Doxygen-4f4688844b3c6ff67782c2be95b2ceb195702067.zip Doxygen-4f4688844b3c6ff67782c2be95b2ceb195702067.tar.gz Doxygen-4f4688844b3c6ff67782c2be95b2ceb195702067.tar.bz2 |
Merge branch 'master' into feature/bug_code_lang
Diffstat (limited to 'src/docvisitor.cpp')
-rw-r--r-- | src/docvisitor.cpp | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/docvisitor.cpp b/src/docvisitor.cpp index d46d8c0..506c9f8 100644 --- a/src/docvisitor.cpp +++ b/src/docvisitor.cpp @@ -14,6 +14,7 @@ #include <unordered_map> +#include <stack> #include "parserintf.h" #include "docvisitor.h" @@ -25,6 +26,7 @@ struct DocVisitor::Private { int id; std::unordered_map< std::string, std::unique_ptr<CodeParserInterface> > parserFactoryMap; + std::stack<bool> hidden; }; DocVisitor::DocVisitor(int id) : m_p(std::make_unique<Private>()) @@ -36,9 +38,9 @@ DocVisitor::~DocVisitor() { } -CodeParserInterface &DocVisitor::getCodeParser(const char *extension) +CodeParserInterface &DocVisitor::getCodeParser(const QCString &extension) { - std::string ext(extension?extension:""); + std::string ext = extension.str(); // for each extension we create a code parser once per visitor, so that // the context of the same parser object is reused throughout multiple passes for instance // for code fragments shown via dontinclude. @@ -56,3 +58,16 @@ int DocVisitor::id() const { return m_p->id; } + +void DocVisitor::pushHidden(bool hide) +{ + m_p->hidden.push(hide); +} + +bool DocVisitor::popHidden() +{ + if (m_p->hidden.empty()) return false; + bool v = m_p->hidden.top(); + m_p->hidden.pop(); + return v; +} |