aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2/ApiExtractor/abstractmetalang.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'sources/shiboken2/ApiExtractor/abstractmetalang.cpp')
-rw-r--r--sources/shiboken2/ApiExtractor/abstractmetalang.cpp29
1 files changed, 27 insertions, 2 deletions
diff --git a/sources/shiboken2/ApiExtractor/abstractmetalang.cpp b/sources/shiboken2/ApiExtractor/abstractmetalang.cpp
index 00d2ffb89..512efef58 100644
--- a/sources/shiboken2/ApiExtractor/abstractmetalang.cpp
+++ b/sources/shiboken2/ApiExtractor/abstractmetalang.cpp
@@ -452,10 +452,32 @@ QDebug operator<<(QDebug d, const AbstractMetaArgument *aa)
* AbstractMetaFunction
*/
+AbstractMetaFunction::AbstractMetaFunction(const AddedFunctionPtr &addedFunc) :
+ AbstractMetaFunction()
+{
+ m_addedFunction = addedFunc;
+ setConstant(addedFunc->isConstant());
+ setName(addedFunc->name());
+ setOriginalName(addedFunc->name());
+ auto atts = attributes() | AbstractMetaAttributes::FinalInTargetLang;
+ switch (addedFunc->access()) {
+ case AddedFunction::InvalidAccess:
+ break;
+ case AddedFunction::Protected:
+ atts |= AbstractMetaAttributes::Protected;
+ break;
+ case AddedFunction::Public:
+ atts |= AbstractMetaAttributes::Public;
+ break;
+ }
+ if (addedFunc->isStatic())
+ atts |= AbstractMetaFunction::Static;
+ setAttributes(atts);
+}
+
AbstractMetaFunction::AbstractMetaFunction()
: m_constant(false),
m_reverse(false),
- m_userAdded(false),
m_explicit(false),
m_pointerOperator(false),
m_isCallOperator(false)
@@ -579,6 +601,7 @@ AbstractMetaFunction *AbstractMetaFunction::copy() const
cpy->setExceptionSpecification(m_exceptionSpecification);
cpy->setAllowThreadModification(m_allowThreadModification);
cpy->setExceptionHandlingModification(m_exceptionHandlingModification);
+ cpy->m_addedFunction = m_addedFunction;
for (AbstractMetaArgument *arg : m_arguments)
cpy->addArgument(arg->copy());
@@ -942,6 +965,8 @@ QString AbstractMetaFunction::debugSignature() const
FunctionModificationList AbstractMetaFunction::modifications(const AbstractMetaClass* implementor) const
{
+ if (!m_addedFunction.isNull())
+ return m_addedFunction->modifications;
if (!implementor)
implementor = ownerClass();
@@ -1279,7 +1304,7 @@ void AbstractMetaFunction::formatDebugVerbose(QDebug &d) const
d << " [const]";
if (m_reverse)
d << " [reverse]";
- if (m_userAdded)
+ if (isUserAdded())
d << " [userAdded]";
if (m_explicit)
d << " [explicit]";