diff --git a/lib/symboldatabase.cpp b/lib/symboldatabase.cpp index e2ec9df79..25f7c3bf5 100644 --- a/lib/symboldatabase.cpp +++ b/lib/symboldatabase.cpp @@ -2628,16 +2628,7 @@ void SymbolDatabase::printVariable(const Variable *var, const char *indent) cons } } std::cout << indent << "mIndex: " << var->index() << std::endl; - std::cout << indent << "mAccess: " << - (var->isPublic() ? "Public" : - var->isProtected() ? "Protected" : - var->isPrivate() ? "Private" : - var->isGlobal() ? "Global" : - var->isNamespace() ? "Namespace" : - var->isArgument() ? "Argument" : - var->isLocal() ? "Local" : - var->isThrow() ? "Throw" : - "Unknown") << std::endl; + std::cout << indent << "mAccess: " << accessControlToString(var->accessControl()) << std::endl; std::cout << indent << "mFlags: " << std::endl; std::cout << indent << " isMutable: " << var->isMutable() << std::endl; std::cout << indent << " isStatic: " << var->isStatic() << std::endl; @@ -2704,10 +2695,7 @@ void SymbolDatabase::printOut(const char *title) const func->type == Function::eDestructor ? "Destructor" : func->type == Function::eFunction ? "Function" : "Unknown") << std::endl; - std::cout << " access: " << (func->access == Public ? "Public" : - func->access == Protected ? "Protected" : - func->access == Private ? "Private" : - "Unknown") << std::endl; + std::cout << " access: " << accessControlToString(func->access) << std::endl; std::cout << " hasBody: " << func->hasBody() << std::endl; std::cout << " isInline: " << func->isInline() << std::endl; std::cout << " isConst: " << func->isConst() << std::endl; diff --git a/lib/symboldatabase.h b/lib/symboldatabase.h index 48900c96a..cde12f7ee 100644 --- a/lib/symboldatabase.h +++ b/lib/symboldatabase.h @@ -605,6 +605,10 @@ public: void setValueType(const ValueType &valueType); + AccessControl accessControl() const { + return mAccess; + } + private: // only symbol database can change the type friend class SymbolDatabase;