16#ifndef SCOPEDTYPEVARIANT_H
17#define SCOPEDTYPEVARIANT_H
51 using Variant = std::variant<DummyDef,LocalDef,GlobalDef>;
77 using Scope = std::unordered_map<std::string,ScopedTypeVariant>;
102 scope->emplace(name.
str(),std::move(stv));
107 if (name.
isEmpty())
return result;
113 auto it2 = it->find(name.
str());
114 if (it2 != std::end(*it))
116 result = &it2->second;
125 result = &it2->second;
162 m_stvList.emplace_back(name_,type_,bracketCount_);
const ScopedTypeVariant getScope() const
void popScope(QCString &name_, QCString &type_, int &bracketCount_)
void setScope(const ScopedTypeVariant &stv)
void pushScope(const QCString &name_, const QCString &type_, int bracketCount_)
std::vector< Ctx > m_stvList
The common base class of all entity definitions found in the sources.
Class representing a local class definition found while generating syntax highlighted code.
std::vector< QCString > baseClasses() const
std::vector< QCString > m_baseClasses
void insertBaseClass(const QCString &name)
This is an alternative implementation of QCString.
bool isEmpty() const
Returns TRUE iff the string is empty.
const std::string & str() const
ScopedTypeVariant(const QCString &name)
const LocalDef * localDef() const
const Definition * GlobalDef
std::variant< DummyDef, LocalDef, GlobalDef > Variant
const Definition * globalDef() const
ScopedTypeVariant(GlobalDef d=nullptr)
bool atGlobalScope() const
std::vector< Scope > m_scopes
void addVariable(const QCString &name, ScopedTypeVariant stv)
const ScopedTypeVariant * findVariable(const QCString &name)
std::unordered_map< std::string, ScopedTypeVariant > Scope
Ctx(const QCString &name_, const QCString &type_, int bracketCount_)