Refactoring: reuse utility function in SymbolDatabase

This commit is contained in:
Daniel Marjamäki 2018-11-04 13:29:29 +01:00
parent 6878de2c5e
commit efd92fd714
2 changed files with 6 additions and 14 deletions

View File

@ -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 << "mIndex: " << var->index() << std::endl;
std::cout << indent << "mAccess: " << std::cout << indent << "mAccess: " << accessControlToString(var->accessControl()) << std::endl;
(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 << "mFlags: " << std::endl; std::cout << indent << "mFlags: " << std::endl;
std::cout << indent << " isMutable: " << var->isMutable() << std::endl; std::cout << indent << " isMutable: " << var->isMutable() << std::endl;
std::cout << indent << " isStatic: " << var->isStatic() << 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::eDestructor ? "Destructor" :
func->type == Function::eFunction ? "Function" : func->type == Function::eFunction ? "Function" :
"Unknown") << std::endl; "Unknown") << std::endl;
std::cout << " access: " << (func->access == Public ? "Public" : std::cout << " access: " << accessControlToString(func->access) << std::endl;
func->access == Protected ? "Protected" :
func->access == Private ? "Private" :
"Unknown") << std::endl;
std::cout << " hasBody: " << func->hasBody() << std::endl; std::cout << " hasBody: " << func->hasBody() << std::endl;
std::cout << " isInline: " << func->isInline() << std::endl; std::cout << " isInline: " << func->isInline() << std::endl;
std::cout << " isConst: " << func->isConst() << std::endl; std::cout << " isConst: " << func->isConst() << std::endl;

View File

@ -605,6 +605,10 @@ public:
void setValueType(const ValueType &valueType); void setValueType(const ValueType &valueType);
AccessControl accessControl() const {
return mAccess;
}
private: private:
// only symbol database can change the type // only symbol database can change the type
friend class SymbolDatabase; friend class SymbolDatabase;